Suggestions in local locators not showing all results

627
19
04-08-2020 05:35 PM
TimConfare1
New Contributor II

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.

Tags (2)
0 Kudos
19 Replies
ErwinSoekianto
Esri Regular Contributor

After going through the documentation from ArcGIS Runtime SDK for Qt‌ regarding LocatorTask and SuggestParameter, I don't see any way to control that from the code. 

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 including ArcGIS Runtime SDK for Qt and ArcGIS Pro to see anyone in this group who can help clarify this.  

0 Kudos
TimConfare1
New Contributor II

Have you heard back from anyone about this?  This is very frustrating as it makes a locator useless if it can only suggest matches from the beginning of a word.  Thanks

0 Kudos
BradNiemand
Esri Regular Contributor

Tim,

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.

Brad

0 Kudos
TimConfare1
New Contributor II

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.

0 Kudos
BradNiemand
Esri Regular Contributor

Tim,

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.

Thanks,

Brad

0 Kudos
TimConfare1
New Contributor II

It represents the location of the animal enclosure or building.  And you are correct, it is an application that allows you to find features in a zoo.

Thanks!

0 Kudos
BradNiemand
Esri Regular Contributor

Tim,

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.

Brad

0 Kudos
TimConfare1
New Contributor II

Brad,

Thank you for this info!  I believe I am using the latest version of runtime but how can I check?  I will try this out and let you know how it goes.

0 Kudos
ErwinSoekianto
Esri Regular Contributor

Tim, the latest Runtime version is 100.7 comes with AppStudio 4.2, you can check them in AppStudio by checking in the About page. 

0 Kudos