Select to view content in your preferred language

gis.content.search(query='tags: tag-word') not finding all content with tag-word

306
2
Jump to solution
03-11-2024 10:39 AM
AlcoGISUser
New Contributor III

I am trying to make a list of all portal items in my content that have a 'tbd' or 'TBD' tag (indicating 'to be deleted').  However, the list only contains 20 items but there should be 33 according to doing a search on the portal site using either 'tbd or 'TBD'. 

gis = GIS(url = 'https://myportalorg.org/arcgis/sharing/', username = 'username', password = 'password')

dList1 = gis.content.search(query='tags:tbd')

dList2 = gis.content.search(query='tags:TBD')

delList = dList1 + dList2

len(delList)

20

I did a check on one of the items not showing up using its item ID:

delItem = gis.content.get('99999999999999999999999999')

delItem.tags

['Analysis Result', 'Join Features', 'tbd']

 

Why aren't all of the items with the 'tbd' or 'TBD' tags not showing up in the list after running the content searches?

 

 

 

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

Specify your max_items parameter. For unlimited search results, use max_items=-1.

- Josh Carlson
Kendall County GIS

View solution in original post

0 Kudos
2 Replies
jcarlson
MVP Esteemed Contributor

Specify your max_items parameter. For unlimited search results, use max_items=-1.

- Josh Carlson
Kendall County GIS
0 Kudos
AlcoGISUser
New Contributor III

That worked! Thank you.

0 Kudos