Search Widget - Search Multiple Times When Space is Entered

1480
3
12-22-2016 01:45 PM
MeleKoneya
Occasional Contributor III

I like the speed and ease of use of the ArcGIS JavaScript Search Widget.

I would like to modify it to search and return suggestions each time a space is entered.    We have some addresses in our City which would be easier to find if we could execute the search each time a space was entered and return some suggestions.

For instance,    The Full Address is 10099 E HAPPY RIDGE RD APT 305 and I would like to allow the user to enter just portions of the address such as 10099 HAPPY RIDGE 305 and Get the same suggestions back as entering the full address.

It looks like the search is conducting a LIKE on the string so I would like to do a LIKE each time a space is entered.

Anyone modified the Search Widget to do something like this?

Thanks,

Mele

0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus

Mele,

   I find this question odd, because when I do a search each character I type fires a suggestions call to the server if your server version supports suggestions.

Search | API Reference | ArcGIS API for JavaScript 3.19 | suggestionDelay 

0 Kudos
MeleKoneya
Occasional Contributor III

Robert,   Yes,  we are using a map service that does support suggestions and it does return results,  but what I would like to do is to be able to have it return results without all of the address being sequential.

In the example I posted for 10099 E HAPPY RIDGE RD APT 305 

If I type in "10099" I get results or "10099 E" or "10099 E HAP"   I get results but if I leave out the direction and just type "10099 HAP"  I don't get anything back.    I understand that the LIKE query is looking for the direction component.

I would like to have the user input just portions without the direction and get results.

Thanks

Mele

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Mele,

   Not sure that what you are wanting is possible then.

0 Kudos