Skip to content

gis.content.search() tags parameter returns items with tags that are not exact match #2398

@northwoodsmi

Description

@northwoodsmi

Describe the bug

When using tags as a parameter in the gis.content.search() method, any tag that contains the string provided will be returned. Using the tags in the filter section of the UI only returns items that are tagged with an exact match. This parameter should allow for both the operator "contains" or "equals" to allow for exact match or not.

Per this documentation this should only return items with the string provided in the tags:

https://developers.arcgis.com/documentation/portal-and-data-services/portal-service/search/how-to-search-for-an-item

To Reproduce
Steps to reproduce the behavior:

from arcgis.gis import GIS

gis = GIS(url="https://portal.domain.com/webadaptor", username="user_name", password="my.password")
print(f'Logged in to {gis.url} as: {gis.properties.user.username}')

tagged_items = gis.content.search(query="tags:"Historic"", max_items=99)
count_of_tagged_items = len(tagged_items)
print(count_of_tagged_items, " tagged items")

Screenshots

Image Image Image

Expected behavior
The tags parameter should only return the items with the exact tag in the tags section, not items that contain the tag in the description. Otherwise, an operator should be allowed in the method for "contains" or "equals"

Platform (please complete the following information):

  • OS: Windows 11
  • Browser: Chrome
  • Python API Version: 2.3.0

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions