Dear all,
We are working on a web-map with an integrated search function (built on the ArcGIS API for JavaScript), based on county names, which are requested from a feature service - here the map:
Cruzada Nacional contra el Hambre en Oaxaca
The function works fine, but just when you put the names exactly like they are written in the feature service. Is there a way to define a non-case sensitive search function?
E.g.
How can we define a more flexible search function that also responds to case 2-4?
Thank you & best regards,
Flo
Solved! Go to Solution.
Flo,
reading your question again it's not really just a case of searching for case sensitivity, you would be better using a like statement to search for a particular word:
query.where = "NOM_MUN LIKE '%"+ campo +"%'";
this will allow you to type in Tavela and get a result
I'm still not seeing a search bar in IE11:
Flo,
You have not tagged your question so it is hard to know what application, language you are referring to.
If your are you using a SQL statement as you could add an upper or lower function to convert the case so that they will be the same, e.g:
UPPER(Name) = UPPER(Value)
Thank you Anthony, it´s the ArcGIS JavaScript API - I´ve updated the question.
I cannot see any search function on the link you have posted up.
Are you building up a SQL command to that is passed to the server? If so just build in the UPPER functions above into your SQL
Mhhh ... well there is a ComboBox"Seleccione un municipio" (next to the zoom in/out) button, where you can select/search counties.
The query is build like this;
var query = new esri.tasks.Query();
query.where = "NOM_MUN = '"+ campo +"'";
NOM_MUN contains the county names.
thank you,
Flo
Flo,
reading your question again it's not really just a case of searching for case sensitivity, you would be better using a like statement to search for a particular word:
query.where = "NOM_MUN LIKE '%"+ campo +"%'";
this will allow you to type in Tavela and get a result
I'm still not seeing a search bar in IE11:
Thank you very much for the hint and for clarifying the issue. Our programmer will give it a try, than we´ll update the thread ...
cheers,
Flo
P.S.: It works here also in IE11 - you just have the wait until the map is loaded completely.
Hi Anthony,
LIKE works fine - thank you very much!
However, we would like, that the combobox shows the same behaviour, i.e. that it lists all counties that contain a name´s part - but I guess that´s a dojo/dijit issue, so we´ll close this thread with "answered".