Autocomplete - erroneous results
Hi All,
I have a form with an autocomplete box that is populated by a 1=1 query of an ArcGIS Server layer REST endpoint. My display field has content that starts with a letter and a dash followed by numbers. i.e.:
D-7574
C-4324
If I type "D-" into the combo box, I don't get the first item from the list above (D-7574). I don't even get the expected value back if I type the full value (D-7574) into the auto-complete box. Example:

I am using Geocortex 4.6.1 and HTML Viewer 2.7. Any help would be appreciated.
Thanks,
Maura
0
-
What is the maximum number of records returned by the underlying service. What if you increase this? 0 -
It's set at 1000 right now. It would make sense that this would be the problem. How does the autocomplete get it's list of values? Does it do 1 query to the AGS rest endpoint at startup and work with that set of values only? Or does it refresh with each keystroke into the search box? 0 -
My layer has over 31K records. Unfortunately upping the record count is not feasible. I would love to hear any suggestions you might have. 0 -
Are you using 1=1 in the Autocomplete Where Clause? If so, that would be why you're getting a list of all values from your layer. Autocomplete gets its list of values based on what you sets its Where Clause to, so 1=1 will return all unique values from the field in your layer (which is what it looks like is happening in your image).
If you want search results to show up based on what the user types, you would use a Where Clause like:
YourFieldName LIKE '{0}%'
{0} is the placeholder for user input, so in plain language the query would say return values that start with the characters the user types.0 -
You could also use a textbox for input with a query task rather than autocomplete - I find autocomplete takes too long to load values for a large amount of features.
I have a workflow that takes the users input as a form textbox, then uses that input to search a query task using the below like clause. Of course, this results in all values that are similiar but you can tweak it
"ID LIKE '%" + textboxinput + "%'"0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
6 kommentarer