Select to view content in your preferred language

Disable LIKE Search in Web App?

1109
2
09-15-2016 10:57 AM
MarthaSelig1
Emerging Contributor
We are using the standard Map Tools template for a web app and have enabled a search by parcel number, with 
suggestions enabled. Despite setting it to exact match, the search executes a LIKE search. 



Since our parcel layer contains nearly 2.4 million records, this returns results extremely slowly, even though the 
field is indexed. Besides, no one searches for a parcel by numbers that may occur anywhere in the string. Is 
there a way I can alter this behavior? Here is the relevant code behind the search set-up.

"searchConfig": {

   "sources": [

       {

          "flayerId": "Landlocked_Parcels_2772.0",

           "url": "http://arcgis.gis.lacounty.gov/arcgis/rest/services/DRP/Landlocked_Parcels/MapServer/0",

          "name": "Parcel (AIN/APN) Search",

          "id": "dojoUnique12",

          "enable": true,

          "enableSuggestions": true,

          "searchWithinMap": true,

           "exactMatch": true,

           "placeholder": "Parcel Search",

          "searchFields": [

            "AIN"

          ],

       "maxSuggestions": 9,

       "displayField": "",

       "suggestionTemplate": ""

      }

   ],

   "activeSourceIndex": 1,

   "enableSearchingAll": false

},

Thanks,

Martha

0 Kudos
2 Replies
KellyGerrow
Esri Alum

Hi Martha,

To control the amount of suggestions or the ability to use suggestions, you can modify the search parameters in the search configuration. Select the Edit button beside the search source name and either disable search or limit the returned results. Try modifying those parameters, and let me know if the performance improves.

Map Tools Configuration

0 Kudos
MarthaSelig1
Emerging Contributor

Thank you, Kelly,

I will certainly have the app's owner experiment with reducing or eliminating suggestions, but the larger problem seems to be that the application starts looking for matches as soon as the first character is entered and it looks everywhere in the string. Neither of these behaviors is desirable in this case and, with 2.4 million records, this is just plain slow.

I will let you know if performance improves.

Thanks,

Martha

0 Kudos