Skip to content

The filter parameter in gis.content.search() are only used if max_items <= 100 #2288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
HakonD opened this issue May 21, 2025 · 0 comments
Labels

Comments

@HakonD
Copy link

HakonD commented May 21, 2025

Describe the bug
When searching for items in the GIS the filter parameter are not used if max_items > 100 or not set. Thus returning all items or only 10.

Additionally, even when the filter is used, the result contains several hits that does not honor the filter but this is a less serious problem.

To Reproduce
Steps to reproduce the behavior:

Sign in to a GIS with one or more Service Proxy items (or modify the code to use a different keyword), and run the added code.

import arcgis

_gis = arcgis.GIS(.....)

_items = _gis.content.search(query="", filter="typeKeywords:Service Proxy")
print(f"Found {len(_items)} items")

_items = _gis.content.search(query="", filter="typeKeywords:Service Proxy", max_items=10)
print(f"Found {len(_items)} items")

_items = _gis.content.search(query="", filter="typeKeywords:Service Proxy", max_items=101)
print(f"Found {len(_items)} items")

error:
Code runs, but returns erroneous result.

Screenshots

Image
The correct number of 'Service Proxy' items in this portal is 5.

Expected behavior
I would expect the code to return the 5 correct items.

Platform (please complete the following information):

  • Python API Version: 2.4.1
  • ArcGIS Enterprise 11.3 Windows

Additional info

The query [myAGE]/portal/home/content.html?sortField=relevance&sortOrder=desc&searchTerm=typekeywords%3A"Service+Proxy"&view=table#org returns the correct number of items.

@HakonD HakonD added the bug label May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant