Select to view content in your preferred language

gis.content.search doesn't find all the items?

1699
3
Jump to solution
07-02-2021 12:09 PM
Manu
by
Regular Contributor

I have some Feature Layers on ArcGIS Online and I want to access them via Python. However, I cannot find the latest layer I created with gis.content.search.

This is how it looks like in ArcGIS Online:

View in ArcGIS OnlineView in ArcGIS Online

 

However, when I run gis.content.search("owner:{0}".format("manuel.popp_KIT")) in Python, the output is:

In [28]: gis.content.search("owner:{0}".format("manuel.popp_KIT"))
Out[28]:
[<Item title:"B1_6_0003" type:Feature Layer Collection owner:manuel.popp_KIT>,
<Item title:"B1_6_0078" type:Feature Layer Collection owner:manuel.popp_KIT>,
<Item title:"B1_6_0063" type:Feature Layer Collection owner:manuel.popp_KIT>,
<Item title:"B1_6_0119" type:Feature Layer Collection owner:manuel.popp_KIT>,
<Item title:"B1_6_0136" type:Feature Layer Collection owner:manuel.popp_KIT>,
<Item title:"B1_6_0086" type:Feature Layer Collection owner:manuel.popp_KIT>,
<Item title:"Extents" type:Feature Layer Collection owner:manuel.popp_KIT>,
<Item title:"B1_6_0023" type:Feature Layer Collection owner:manuel.popp_KIT>,
<Item title:"Areas_B3_4" type:Feature Layer Collection owner:manuel.popp_KIT>,
<Item title:"Areas_B3_4" type:Service Definition owner:manuel.popp_KIT>]

Where is "B1_6_0140"? It worked quite well until now and the missing item was created just as the other similar ones. How can it be missing?

0 Kudos
1 Solution

Accepted Solutions
DavidPike
MVP Frequent Contributor

missing the max_items argument, default is only 10

 

gis.content.search("owner:{0}".format("manuel.popp_KIT"), max_items=100)

 

https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#contentmanager

 

View solution in original post

3 Replies
DavidPike
MVP Frequent Contributor

missing the max_items argument, default is only 10

 

gis.content.search("owner:{0}".format("manuel.popp_KIT"), max_items=100)

 

https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#contentmanager

 

Manu
by
Regular Contributor

Thanks, I didn't expect there was a limit of 10 items

0 Kudos
DavidPike
MVP Frequent Contributor

No problem, just fyi I've seen max_items=-1 used also, which I guess is unlimited results, but I've not bothered to test that myself. 

0 Kudos