Select to view content in your preferred language

gis.content.search --> exclude a user

1705
3
Jump to solution
07-26-2019 06:38 PM
Michael_Knapp
Regular Contributor

hi there -

 I'm trying o build a list of our Portal content, but we have Living Atlas enabled, and even with "outside_org=False" , the search still return all the living atlas layers. There's probably an easy way to exclude them, but I can't quite see it. 

Here's the search line:

services = gis.content.search(query="", item_type="Feature Layer", max_items=maxItems, outside_org=False)

any help would be much appreciated!

Thanks.

Mike Knapp

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
EarlMedina
Esri Regular Contributor

Hi Mike,

You can do that like so:

services = gis.content.search(query="NOT owner: username", item_type="Feature Layer", max_items=maxItems, outside_org=False)

Hope this helps,

Earl

View solution in original post

3 Replies
EarlMedina
Esri Regular Contributor

Hi Mike,

You can do that like so:

services = gis.content.search(query="NOT owner: username", item_type="Feature Layer", max_items=maxItems, outside_org=False)

Hope this helps,

Earl

MichaelKnapp1
New Contributor

Thanks Earl (I'm responding from a different account!) That worked perfectly. 

0 Kudos
Brian_Wilson
Honored Contributor

Curious how this could work -- won't it only remove users named "username"? I use "NOT owner:esri_*" as the query to omit outside content and that seems to work.

I wonder why Esri has not fixed this bug in 3 years. 

0 Kudos