ArcGIS Blog

Mapping

ArcGIS Online

Searching for Features in Maps and Apps

By Russell Roberts

We recently enhanced the Search widget in that you will see across all web apps like Map Viewer, Map Viewer Classic, Instant Apps, Experience Builder and Web AppBuilder.  The recent change to the Search widget can return faster results more efficiently and maintain stability for the layers being used to search for features. The layer-based search performance benefits increase as the number of features increase, the searched term character count length increases, and the field being searched also has more data along with repeated searches.

Updates Made to Search Widget

Using Full-Text field indexes for layer-based feature searches with ArcGIS Online hosted feature layers.

First off you are probably asking – What is a Full-text field index?

This type of index is created when you author a feature search under the application settings of a web map or in the instant apps layer-based search configuration. When the index is created essentially it will take the field specified in the search configuration and then scan the data in the field and tokenize the words within each row. Which pretty much means behind the scenes we are splitting up the data in the field into smaller units, such as individual words or terms that will improve the overall search performance.

Example:
Search is configured on layer with all the US Post Offices and using the Name field. An example result on the name field is Highlandtown Station Baltimore Post Office. The index will split up this example into these searchable terms Highlandtown Station Baltimore Post Office. This will make all the the terms now searchable with the full-text index where you could search Baltimore Office, Highland Baltimore, Stat Balt Office and be able to retrieve this feature from the search results.

How does the Search widget use these indexes?

The Search widget will now leverage Full-Text field indexes on hosted feature layers layer-based source searches. The index automatically gets generated when feature search is authored on a field for a hosted feature layer in web maps authored after the November 2022 release. You can update existing maps or create new ones to generate these indexes, so if this index type exists on the field being searched the widget will use it automatically. The search type being used in the search widget is called prefix. This will query the field with the characters searched and return results for words that begin with the specified text. These indexes greatly improve performance and stability especially with large search terms which we have seen with our testing take sub second vs. the double wildcard taking over ten seconds (more on the wildcard changes below). You can see an example of this prefix query in the above example Stat Balt Office where the prefix search is used to find Station, Baltimore and then a complete term Office.  However, searched for More you would not get results for Baltimore.

Remove the leading wildcard for layer-based feature searches.

When searching for features using the Contains layer-based search and for suggested results on Equals the search widget in previous releases would send the searched for term using the LIKE operator and a % wildcard on each side of the term. This would then go through the field set in the layer-based feature search and try and match that character pattern with all the data in the field. This becomes a very heavy query when the number of characters in the search term increases the amount of data that has to be scanned in each row and the number of rows that exist. Eventually this could cause issues for your content as traffic increases, the number of features that exist increases and more searches are performed on your data.

Example:
Search is configured on the layer Post Office and using the field Name on a layer with NO Full-Text Index. When searching for Highlandtown Station Baltimore Post Office the entered search text would have to now start with Hig to start returning results that begin with Hig and Highlandtown Station Baltimore Post Office falls within that searched character pattern and could be a returned result. This is because the leading wildcard is not used, and the query becomes “starts with”.  The change will not support being able to search for other character patterns that could happen elsewhere in the string like searching for example searching Baltimore will not return Highlandtown Station Baltimore Post Office but would return any results that start with Baltimore.

What’s Next

First off – I hope this blog helps you understand the recent changes we made to searching for features. We want to bring you faster results and stability to your content. Up next we have plans for bringing the Search authoring experience into Map Viewer. This will make building and trying out your searching you author easier and faster.  We also have plans to expose the indexes that exist on you’re layers to make it easier to understand what indexes exist and give you additional controls there. Please leave feedback here in the blog post or reference this blog if you have any questions in the Esri Community.

Share this article

Subscribe
Notify of
29 Comments
Oldest
Newest
Inline Feedbacks
View all comments
Tobias Fimpel(@fimpe001_uservices)
December 1, 2022 6:50 am

Russell, can you share any information on plans to enable this for Feature Layers that are not “hosted” but are “registered” ArcGIS Server services? Is there a realistic chance of that happening? That would help us plan ahead. Great blog post, thank you.

Ryan Bohan(@ryanbohan)
December 1, 2022 10:23 am

How will Full-Text Field Indexes work for feature layers we do not own? If an index is created when the search is added, assume you need to be the owner of the feature layer.

What is the feature layer is either a Living Atlas layer, or another agencies rest service. What is the best way to add a search to those layers?

Ryan Bohan(@ryanbohan)
December 1, 2022 11:02 am

Thank for for the fast response.

For the non-index cases does the lack of leading wildcard mean you are unable to search “Baltimore Post Office“.

When the full name is “Highlandtown Station Baltimore Post Office”, previously we have used contain for this, recently have seen some issues with the search results.

Last edited 2 years ago by Ryan Bohan
Ryan Bohan(@ryanbohan)
December 1, 2022 11:28 am

Awesome, great to know thank you.

Ryan Bohan(@ryanbohan)
April 26, 2023 1:45 pm
Reply to  Ryan Bohan

I wish there was an option to automatically add the “%” in the search configuration options. The general public would not think to add it if they are just trying to find a Post Office.

Adding the indexing is only an option, if I own the data.

Jeannette K Byrd(@tuscco)
December 5, 2022 6:02 am

Is this something that is implemented automatically when we create a hosted feature service? Also, you mentioned Instant Apps and the application settings of a web map – is there documentation on how to do this in the settings of a web map? What about Experience Builder?

Geraldine Eggermont(@go_fmis)
December 6, 2022 12:15 am

The Search widget doesn’t work in our maps since the November release. Or it works as ‘starts with’ while the search is configured as ‘contains’. I could repair this in a few maps by deleting/re-adding the search on layer settings, but this trick doesn’t work with most maps. This is really annoying and confusing for our users, is it meant to be so? This is not documented, and our local distributor didn’t seem to be aware of the problem neither. Are we really the only ones experiencing this?

Geraldine Eggermont(@go_fmis)
December 7, 2022 8:20 am

Hi Russell, the first option doesn’t work in most cases, so I’d like to hear about the second one, thank you.

Geraldine Eggermont(@go_fmis)
December 9, 2022 2:53 am

It just doesn’t work with a layer with views, I can’t use addToDefinition.

Error message:

Unable to add feature service layer definition. Not supported. Schema changes are not allowed for service. 

Adding the index works for another layer without views, I can see the index is added when printing the properties, but the search still doesn’t work in the map, even after deleting the map’s search conditions – saving – re-adding the search conditions.

So what do I do now? This really sucks, the search widget was working perfectly before, this is not an enhancement but a regression for us.

Geraldine Eggermont(@go_fmis)
December 9, 2022 6:39 am

Hi Russell, I have a ticket logged with my local distributor since 25 November (#03206890). They say they’re in touch with Esri US. Do you have access to it?

Geraldine Eggermont(@go_fmis)
December 9, 2022 7:42 am

I’m not using the views. But the feature layer I’d like to update (and can’t) has related views.

Geraldine Eggermont(@go_fmis)
December 9, 2022 7:44 am

And anyway, the search still doesn’t work with a layer with a full text index successfully added.

Geraldine Eggermont(@go_fmis)
December 9, 2022 7:51 am

I said it doesn’t work with a layer with views. How could I give you access to the maps and layers?

Geraldine Eggermont(@go_fmis)
December 9, 2022 8:08 am

I’ve invited you to a group with the maps and layers, but not sure how I can add them to the case. And should I keep on writing here, or via the case, or email?

Geraldine Eggermont(@go_fmis)
December 9, 2022 9:02 am

OK, done. Thanks!

Dylan Kennard(@dylan-kennard_oga)
September 25, 2023 2:15 pm

9/25/2023 – Russell I have enabled search on my “Web Map”. This then automatically as noted in documentation enables that search in the “Field Apps”. I see documentation that says it also instantly enables that search in the new apps. I have an “Instant – Side Bar App” and the search bar shows my configurable words from the “Web Map” in that App where I put “Hint Text – Search My Data” but nothing returns. Is there still some disconnect? I wanted to avoid configuring the search in the “Instant – Side Bar App”

Dylan Kennard(@dylan-kennard_oga)
September 25, 2023 2:19 pm
Reply to  Dylan Kennard

Solved it: In the “Instant – Side Bar App” I had to enable “Search Configuration – All Sources”. Otherwise it was just searching my top layer.