Select to view content in your preferred language

Query matching matching multiple search terms

625
2
03-24-2021 10:52 AM
bcasu
by
New Contributor II

I am trying to write a query using a wildcard that will return the results of terms put into a search box. It works fine if someone searches for terms in a specific order. For example, if someone searches "Soils Phoenix" it will return the results fine if the title is like "Map of Soils Pheonix." However, if the search is "Phoenix Soils" it returns no results. I want to match all of the terms, regardless of the order. It should also be able to take any number of terms not just two.

The query that I am using is: WHERE Title LIKE '%searchterm%'

 

Any advice would be appreciated. 

0 Kudos
2 Replies
JoshuaBixby
MVP Esteemed Contributor

Are you querying AGOL or ArcGIS Enterprise portal?  If the latter, what is your back-end data store, i.e., hosted feature service in ArcGIS Data Store or an enterprise geodatabase?

You are interested in having the search terms be in any order, but do all the terms have to exist?  For example, would searching on "Soils Phoenix" and finding records with only "Soils" or only "Phoenix" work?

0 Kudos
bcasu
by
New Contributor II

Here is a link to the table I am querying: https://services3.arcgis.com/0OPQIK59PJJqLK0A/ArcGIS/rest/services/maps129/FeatureServer/0

I believe this is a feature service in the data portal. All of the major search terms should exist. Words like "and, or, the" need not exist I suppose. Thanks for your help. 

 

0 Kudos