Select to view content in your preferred language

SearchWidget

1316
8
Jump to solution
04-24-2013 05:04 AM
lifeEsri
Occasional Contributor
I have this error when executing my searchWidget

[ATTACH=CONFIG]23736[/ATTACH]
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RhettZufelt
MVP Notable Contributor

<?xml version="1.0" ?>
<configuration label="Louisville Parcels and Police">
<layers>
<layer>
<name>accidents</name>
<url>http://localhost:6080/arcgis/rest/services/SIGMALOGITEC/servicetest/MapServer/0</url>
<expression>accident = [value]</expression>
<textsearchlabel>Search by Parcel ID [ Example: 181001490000 or 1810%]</textsearchlabel>
<titlefield>accident</titlefield>
<linkfield></linkfield>
<fields all="false">
<field name="accident" alias="accident"/>
</fields>
</layer>
<layer>
<name>arrandissement</name>
<url>http://localhost:6080/arcgis/rest/services/SIGMALOGITEC/servicetest/MapServer/1</url>
<expression>objectid = [value]</expression>
<textsearchlabel>Search by Parcel ID [ Example: 181001490000 or 1810%]</textsearchlabel>
<titlefield>objectid</titlefield>
<linkfield></linkfield>
<fields all="false">
<field name="objectid"/>
</fields>
</layer>
</layers>
<zoomscale>10000</zoomscale>
</configuration>


You are searching a number field, so as Robert pointed out, you need to remove the quotes. Also, LIKE looks for some matching operator (normally % depending on data source) and does not appear to work with number fields (at least not in ArcMap). You can query for a range of numbers, but not LIKE with wildcards.

R_

View solution in original post

0 Kudos
8 Replies
RobertScheitlin__GISP
MVP Emeritus
life Esri,

   You need to verify your field names and the SQL of your where clause.
0 Kudos
lifeEsri
Occasional Contributor
life Esri,

   You need to verify your field names and the SQL of your where clause.


I think all is ok but no result

this my filds of first layer(accidents):
[ATTACH=CONFIG]23737[/ATTACH]

and this my searchWidget.xml

<?xml version="1.0" ?>
<configuration label="Louisville Parcels and Police">
<layers>
<layer>
<name>accidents</name>
<url>http://localhost:6080/arcgis/rest/services/SIGMALOGITEC/servicetest/MapServer/0</url>
<expression>accident like '[value]'</expression>
<textsearchlabel>Search by Parcel ID [ Example: 181001490000 or 1810%]</textsearchlabel>
<titlefield>accident</titlefield>
<linkfield></linkfield>
<fields all="false">
<field name="accident" alias="accident"/>
</fields>
</layer>
<layer>
<name>arrandissement</name>
<url>http://localhost:6080/arcgis/rest/services/SIGMALOGITEC/servicetest/MapServer/1</url>
<expression>objectid like '[value]'</expression>
<textsearchlabel>Search by Parcel ID [ Example: 181001490000 or 1810%]</textsearchlabel>
<titlefield>objectid</titlefield>
<linkfield></linkfield>
<fields all="false">
<field name="objectid"/>
</fields>
</layer>
</layers>
<zoomscale>10000</zoomscale>
</configuration>

<!--
See Search widget tag reference at
http://links.esri.com/searchwidget
-->
0 Kudos
lifeEsri
Occasional Contributor
NB: when i use arcGis Server 10 all is ok but when i try to use ArcGis Server 10.1 i have this problem


some help please
and thank in advance
0 Kudos
lifeEsri
Occasional Contributor
some one is here!!

I have a time constraint i need your help please
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Your accidents field is numerical so your SQL should not have single quotes. This is all basic GIS stuff.
0 Kudos
lifeEsri
Occasional Contributor
Your accidents field is numerical so your SQL should not have single quotes. This is all basic GIS stuff.


Robert thank you for you help

but no result
I think i must to check something in the publication of my service in arcgisserver (Query is already checked)

in arcgisServer 10 it work's correctly but in 10.1 no results
0 Kudos
RhettZufelt
MVP Notable Contributor

<?xml version="1.0" ?>
<configuration label="Louisville Parcels and Police">
<layers>
<layer>
<name>accidents</name>
<url>http://localhost:6080/arcgis/rest/services/SIGMALOGITEC/servicetest/MapServer/0</url>
<expression>accident = [value]</expression>
<textsearchlabel>Search by Parcel ID [ Example: 181001490000 or 1810%]</textsearchlabel>
<titlefield>accident</titlefield>
<linkfield></linkfield>
<fields all="false">
<field name="accident" alias="accident"/>
</fields>
</layer>
<layer>
<name>arrandissement</name>
<url>http://localhost:6080/arcgis/rest/services/SIGMALOGITEC/servicetest/MapServer/1</url>
<expression>objectid = [value]</expression>
<textsearchlabel>Search by Parcel ID [ Example: 181001490000 or 1810%]</textsearchlabel>
<titlefield>objectid</titlefield>
<linkfield></linkfield>
<fields all="false">
<field name="objectid"/>
</fields>
</layer>
</layers>
<zoomscale>10000</zoomscale>
</configuration>


You are searching a number field, so as Robert pointed out, you need to remove the quotes. Also, LIKE looks for some matching operator (normally % depending on data source) and does not appear to work with number fields (at least not in ArcMap). You can query for a range of numbers, but not LIKE with wildcards.

R_
0 Kudos
lifeEsri
Occasional Contributor
thank you robert and zufelt for your helps

it's solved
0 Kudos