I created a composite locator from two gazetteer locators that search for name and category. The results of the suggestions are only showing from the beginning of the word. For example, if I search for "lion" it will suggest "lion fish" or "lion parking lot" but not "african lion". I can't find where to include searching the whole word and not from just the beginning. I am developing in AppStudio using the runtime for Qt. I created the locators in ArcGIS Pro.
This could be a limitation in ArcGIS Runtime or there may be something we can do in ArcGIS Pro to enable this on the Locator.
I am trying to understand your use case to hopefully give you some ideas of how to proceed. What does the name "African Lion" represent in the data? Is it an actual location of a lion sighting or is it a place that has that name. What is the application that you are trying to build and what is it's goal?
When I search for things I typically don’t exclude the first part of the string unless the item I am searching for is also known by that name in which case I would instead create an alternate record in the data with the alternate name. Another case could be that you are searching for a category of things like “Parks” or “Coffee” but that is handled by categories and the locator would need to be set up correctly to support that. It looks like you might already be utilizing this feature based on your comment above.
With some additional information, i think I can give you some ideas of how to proceed.
Thanks for you response Brad. I have a point feature that has a field called Name. Another field is called Category. Two of the records in this point feature are named "African Lion" and "Lion Parking Lot". I set up a locator but I expect it to suggest both of those names when a user simply types "lion". None of the locators that I created show both. It will find both records.....it just won't suggest them in the dropdown list.
Also, Categories do no work for locale locators. I can sort of get around this by using the gazetteer style address locator but it is Type that works, not category.
You are correct, suggestions won't show records for input that is not in the same order as what is in the data. We do allow for some omitted words but the first word can't be excluded. Suggestions are intended to help you find exact records, not all records that contain some specific text anywhere in the record. if we showed all records that contain a specific word later in the text, good suggestions would get pushed out of the list. What you are trying to do seems more like a SQL contains query.
One question I still have is what does "African Lion" actually represent in the data? Is it a lion, is it the name of some park or feature, or something else? What is the goal of the application? Is it a locator for a zoo application that allows you to find features in the zoo like "African Lion" and "Lion Parking Lot"? This will help me determine the best approach that you can take.
Sorry, when I referenced categories I was thinking of our new locators that are built using the Create Locator tool in ArcGIS Pro. Depending on the version of runtime you are using, these new locators might even be a better option for you but currently these locators are only supported on 64 bit environments.
This is how I would approach your app.
0. If you have the ability to do so, I would merge the two datasets into a single dataset with a schema that fits both of them.
1. Create categories and subcategories for each record. For instance, category=Animals, subcategory=Lion or subcategory=Lions depending on what you think people will search for but it will show up as a suggestion none the less. You don't need to have subcategories, you could have Lion as the category instead.
2. Use the Create Locator tool in Pro with the POI role to create your locator. There is the ability to map these category and subcategory values when building the locator.
Now if a user searches for "Lion", they will get a suggestion similar to what you see with our online service for categories like Coffee.
If they select this category, they will get all records that have the category of Lion or if the item they are searching for starts with the word "Lion" they will see that and can select that record if it is desired.
If you can't move over to the new locators, you would do similar to what you have done already. Use the Gazetteer style with the type field. Steps 0 and 1 would still apply but you would be limited to just a single "category" or "type" in this case.