How to search items by multiple tags

96
2
Jump to solution
08-06-2020 05:43 AM
BerendVeldkamp
Occasional Contributor II

Hi,

I'm trying to search items in Agol that have one or more tags from a list. For instance, when searching for tag1,tag2, I'd like to find all items that have either tag1 or tag2 (or both).

Some things I've tried:

  • q=tags:tag1,tag2
  • q=tags:tag1 OR tags:tag2

And several permutations of this, but none seem to work. If I search for a single individual tag, it works as expected. The documentation only shows searching for a single tag, but the name of the parameter (tags) suggest multiple tags should be supported.

Is this possible at all, or should I do a separate search for each tag?

Reply
0 Kudos
1 Solution

Accepted Solutions
GeoJosh
Esri Contributor

Hey Berend,

I got this to work by putting the tag in double quotes:

q=tags:"tag1" OR "tag2"

Let me know if this works for you!

Best,

Josh

View solution in original post

2 Replies
GeoJosh
Esri Contributor

Hey Berend,

I got this to work by putting the tag in double quotes:

q=tags:"tag1" OR "tag2"

Let me know if this works for you!

Best,

Josh

View solution in original post

BerendVeldkamp
Occasional Contributor II

Thanks, I had tried q=tags:"tag1" or "tag2" but not q=tags:"tag1" OR "tag2" (uppercase OR). Quotes don't seem to be necessary in this example. This works perfect.

BTW shouldn't it be tags:tag1 OR tags:tag2