<definitionexpression></definitionexpression> <enableexport>true</enableexport> <name>Road Centerlines</name> <url>http://gislap134/ArcGIS/rest/services/Highway/MapServer/5</url> <expressions> <expression alias="Road Name and Zip" textsearchlabel="Search by Road Name and Left Zipcode and Right Zip:"> <values> <value prompt="Exmaple: ANDREW">RD_NAME = '[value]'</value> <value prompt="Exmaple: 36201"> AND ZIP_L = [value]</value> <value prompt="Exmaple: 36201"> AND ZIP_R = [value]</value> </values> </expression> </expressions>(I deleted the other expressions that didn't seem to apply)
<expression alias="SiteCode" textsearchlabel="Search by SiteCode: (enter search text in one box only)"> <values> <value prompt="Search for Matches: Example: 100-D-" field="SITECODE">UPPER(SITECODE) LIKE UPPER('%[value]%')</value> </values> <values> <value prompt="Search EXACT SiteCode" field="SITECODE">UPPER(SITECODE) = UPPER('[value]')</value> </values> </expression>
<expression alias="SiteCode" textsearchlabel="Search by SiteCode: (enter search text in one box only)"> <values> <value prompt="Search for Matches: Example: 100-D-" field="SITECODE">UPPER(SITECODE) LIKE UPPER('%[value]%')</value> </values> <values> <value prompt="Search EXACT SiteCode" field="SITECODE"> OR UPPER(SITECODE) = UPPER('[value]')</value> </values> </expression>
<expression alias="Tract" textsearchlabel="Search by Tract Number: <values> <value prompt="Select All Records" userlist="Select All Records" field="PRJTRACTNO">1=1</value> </values> <values> <value prompt="Search Tract Number" field="PRJTRACTNO">UPPER(PRJTRACTNO) LIKE UPPER(%'[value]'%)</value> </values> </expression>
do you mean something like the search centerline example from the example site (though it actually has three value statements) http://gis.calhouncounty.org/FlexViewer3.0/index.html?config=config-eSearch.xml&search=2&slayer=3&ex... ?
If so, here is the snippet from the eSearchWidget.xml Robert has supplied with the widget that does that.<definitionexpression></definitionexpression> <enableexport>true</enableexport> <name>Road Centerlines</name> <url>http://gislap134/ArcGIS/rest/services/Highway/MapServer/5</url> <expressions> <expression alias="Road Name and Zip" textsearchlabel="Search by Road Name and Left Zipcode and Right Zip:"> <values> <value prompt="Exmaple: ANDREW">RD_NAME = '[value]'</value> <value prompt="Exmaple: 36201"> AND ZIP_L = [value]</value> <value prompt="Exmaple: 36201"> AND ZIP_R = [value]</value> </values> </expression> </expressions>(I deleted the other expressions that didn't seem to apply)
(Don't forget the space before the AND as it is not in the example.xml this way) Can also use OR instead if that is what you need.
Is this what you are after?
Below is a snippet that I am using. It puts two options on the search widget, one lets you put in partial and does a LIKE operation, the other only finds exact matches. But, they are both searching the same layer, same field.<expression alias="SiteCode" textsearchlabel="Search by SiteCode: (enter search text in one box only)"> <values> <value prompt="Search for Matches: Example: 100-D-" field="SITECODE">UPPER(SITECODE) LIKE UPPER('%[value]%')</value> </values> <values> <value prompt="Search EXACT SiteCode" field="SITECODE">UPPER(SITECODE) = UPPER('[value]')</value> </values> </expression><expression alias="SiteCode" textsearchlabel="Search by SiteCode: (enter search text in one box only)"> <values> <value prompt="Search for Matches: Example: 100-D-" field="SITECODE">UPPER(SITECODE) LIKE UPPER('%[value]%')</value> </values> <values> <value prompt="Search EXACT SiteCode" field="SITECODE"> OR UPPER(SITECODE) = UPPER('[value]')</value> </values> </expression>
In the first example, multiple fields are searched, in the second example, you choose which input to use and it searches the same fields but with different expression. The third is similar to the second but will take inputs from both text box's, and if either match, you get the results. Just remember, if you use an AND or OR statement, the first text box MUST have a value in it.
If I understand you correctly, below is what you need.<expression alias="Tract" textsearchlabel="Search by Tract Number: <values> <value prompt="Select All Records" userlist="Select All Records" field="PRJTRACTNO">1=1</value> </values> <values> <value prompt="Search Tract Number" field="PRJTRACTNO">UPPER(PRJTRACTNO) LIKE UPPER(%'[value]'%)</value> </values> </expression>
R_
<expressions> <expression alias="Property Parcels" textsearchlabel="Search by PRJTRACTNO AND OWNER"> <values> <value prompt="Enter Project Number">UPPER(PRJTRACTNO) LIKE UPPER('%[value]%')</value> <value prompt="Enter Owner"> AND UPPER(OWNER) LIKE UPPER('%[value]%')</value> </values> </expression> </expressions>
Thanks so much. I am trying to implement the search with the AND using two fields.
<expressions>
<expression alias="Property Parcels" textsearchlabel="Search by PRJTRACTNO AND OWNER">
<values>
<value prompt="Enter Project Number">UPPER(PRJTRACTNO) LIKE UPPER(%'[value]'%)</value>
<value prompt="Enter Owner"> AND UPPER(OWNER) LIKE UPPER(%'[value]'%)</value>
</values>
</expression>
</expressions>
However I got the error which is showinfg in the attached image
Thanks
Jorge
<expressions>
<expression alias="Property Parcels" textsearchlabel="Search by PRJTRACTNO AND OWNER">
<values>
<value prompt="Enter Project Number">PRJTRACTNO = [value]<value>
<value prompt="Enter Owner"> AND UPPER(OWNER) LIKE UPPER(%'[value]'%)</value>
</values>
</expression>
</expressions>
I would guess that your PRJTRACTNO is actualy a number field and not a text field. If so:
<expressions> <expression alias="Property Parcels" textsearchlabel="Search by PRJTRACTNO AND OWNER"> <values> <value prompt="Enter Project Number">PRJTRACTNO = [value]<value> <value prompt="Enter Owner"> AND UPPER(OWNER) LIKE UPPER(%'[value]'%)</value> </values> </expression> </expressions>
If I try to search a numeric field using text input, I get the same error that you posted.
R_
Of course, as Robert pointed out, the double wildcards can/will match a LOT of values.
<links> <link includeinresults="true" alias="Lyon Co Assessor Parcel Search"> <![CDATA[http://www1.lyon-county.org:403/cgi-bin/asw101?Parcel={YPNO}]]> <icon><![CDATA[assets/images/i_table.png]]></icon> </link> </links>
<links> <link includeinresults="true" alias="Lyon Co Assessor Parcel Search"> <=!=[=C=D=A=T=A=[{YPNO}]=]=> <icon><=!=[=C=D=A=T=A=[assets/images/i_table.png]=]=></icon> </link> </links>
Jorge,
As this widgets developer I would suggest that you pay close attention to my responses to your inquiry. In my last post I corrected some of the text in your expression. Go back to my last post and copy the expression as your had the order of the single qoutes and the percent symbol backwards.