<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: gis.content.search with categories in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/gis-content-search-with-categories/m-p/1315454#M8910</link>
    <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;gis&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;content&lt;/SPAN&gt;&lt;SPAN&gt;.search(&lt;/SPAN&gt;&lt;SPAN&gt;query&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;""&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;categories&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"xxx"&lt;/SPAN&gt;&lt;SPAN&gt;) doesn't return anything for me either.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;But this seems to work&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;gis&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;content&lt;/SPAN&gt;&lt;SPAN&gt;.search(&lt;/SPAN&gt;&lt;SPAN&gt;query&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"categories:xxx")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;For some category names that have spaces in I had to replace the space with an underscore, eg for category name "xxx yyy" it only worked if I wrote it as&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;gis.content.search(query="categories:xxx_yyy")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 04 Aug 2023 11:02:40 GMT</pubDate>
    <dc:creator>amitchinson</dc:creator>
    <dc:date>2023-08-04T11:02:40Z</dc:date>
    <item>
      <title>gis.content.search with categories</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/gis-content-search-with-categories/m-p/1243383#M8207</link>
      <description>&lt;P&gt;Anyone have luck using the categories argument with the search? For me it isn't returning any items even though I've confirmed the item is categorized. I've tried using the full category string and the keyword.&amp;nbsp; None of these return anything:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;item_search = gis.content.search(query = "", categories="/a/b/c/d")&lt;/LI-CODE&gt;&lt;LI-CODE lang="python"&gt;item_search = gis.content.search(query = "", categories="d")&lt;/LI-CODE&gt;&lt;LI-CODE lang="c"&gt;item_search = gis.content.search(query = "", categories="[d]")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 18:03:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/gis-content-search-with-categories/m-p/1243383#M8207</guid>
      <dc:creator>SupriyaK</dc:creator>
      <dc:date>2022-12-22T18:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: gis.content.search with categories</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/gis-content-search-with-categories/m-p/1243573#M8210</link>
      <description>&lt;P&gt;Hey, you were pretty close!&lt;/P&gt;&lt;P&gt;Categories takes a string or list, so form your example it would be either&lt;/P&gt;&lt;LI-CODE lang="python"&gt;item_search = gis.content.search(query="", categories=["/Categories/category_1", "/Categories/category_2"])&lt;/LI-CODE&gt;&lt;P&gt;OR&lt;/P&gt;&lt;LI-CODE lang="python"&gt;item_search = gis.content.search(query="", categories="/Categories/test")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, the key is just to make sure you're writing &lt;FONT face="courier new,courier" color="#008000"&gt;"/Categories/{your_category_name}"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2022 14:11:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/gis-content-search-with-categories/m-p/1243573#M8210</guid>
      <dc:creator>EarlMedina</dc:creator>
      <dc:date>2022-12-23T14:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: gis.content.search with categories</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/gis-content-search-with-categories/m-p/1245017#M8239</link>
      <description>&lt;P&gt;SupriyaK, did you get it working? &amp;nbsp;I'm having the same problem. &amp;nbsp;I've tried many things, nothing works.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;item_search = gis.content.search(query="", categories="/Categories/My Category")
item_search = gis.content.search(query="", categories=["/Categories/My Category"])

cat="/Categories/My Category"
item_search = gis.content.search(query="", categories=cat)
item_search = gis.content.search(query="", categories=[cat])&lt;/LI-CODE&gt;&lt;P&gt;I had spaces in my category name, tried renaming without spaces, still nothing. &amp;nbsp;Tried the query as empty string and with * wildcard, nothing.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 18:21:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/gis-content-search-with-categories/m-p/1245017#M8239</guid>
      <dc:creator>WilliamKyngesburye</dc:creator>
      <dc:date>2023-01-03T18:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: gis.content.search with categories</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/gis-content-search-with-categories/m-p/1245760#M8242</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/86309"&gt;@EarlMedina&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/476915"&gt;@WilliamKyngesburye&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the below and still didn't have anything returned when I looped through the search content. My organization category is nested under two groups which is why I've shown the full category string as "/a/b/c/d". Those letters don't represent multiple categories but the full string of a single category that is nested.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;item_search = gis.content.search(query = "", categories=["/a/b/c/d"])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To make things a bit more clear here is an example for how I am running the search and checking what the search returns.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;item_search = gis.content.search(query = "owner:XXX", max_items=150, categories=["/Categories/Subgroup1/Subgroup2/Category1"])
for item in item_search:
    print(item.title)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2023 19:22:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/gis-content-search-with-categories/m-p/1245760#M8242</guid>
      <dc:creator>SupriyaK</dc:creator>
      <dc:date>2023-01-05T19:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: gis.content.search with categories</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/gis-content-search-with-categories/m-p/1246125#M8243</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/579558"&gt;@SupriyaK&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/476915"&gt;@WilliamKyngesburye&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's what I would do next: go to he Contents page where you're assigning Categories to your items, open your browser's developer tools and switch to the Network tab, clear any existing traffic, make a nominal change to one of your items (add/remove a category), and see what the traffic reports back after you click &lt;STRONG&gt;Save&lt;/STRONG&gt;. You'll be looking for an &lt;EM&gt;updateItems&lt;/EM&gt; request - check what the request body for that is. It should look like this:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;items: [{"abcdefghijklmnop123456789":{"categories":["/Categories/test"]}}]&lt;/LI-CODE&gt;&lt;P&gt;There's probably some encoding to account for if your category has special characters in it.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2023 18:34:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/gis-content-search-with-categories/m-p/1246125#M8243</guid>
      <dc:creator>EarlMedina</dc:creator>
      <dc:date>2023-01-06T18:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: gis.content.search with categories</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/gis-content-search-with-categories/m-p/1246581#M8249</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/86309"&gt;@EarlMedina&lt;/a&gt;&amp;nbsp;Thanks for the idea and providing the request I should look for! I used it to capture the exact string and unfortunately it is the same string I've been using all along.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a feeling you've tested this and are able to get this to work so I wonder if it might be because of my user type, role privileges or how I'm running the script. I've been using Notebooks in ArcGIS Online. I will see if a different user has luck running the script.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2023 19:18:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/gis-content-search-with-categories/m-p/1246581#M8249</guid>
      <dc:creator>SupriyaK</dc:creator>
      <dc:date>2023-01-09T19:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: gis.content.search with categories</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/gis-content-search-with-categories/m-p/1315454#M8910</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;gis&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;content&lt;/SPAN&gt;&lt;SPAN&gt;.search(&lt;/SPAN&gt;&lt;SPAN&gt;query&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;""&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;categories&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"xxx"&lt;/SPAN&gt;&lt;SPAN&gt;) doesn't return anything for me either.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;But this seems to work&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;gis&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;content&lt;/SPAN&gt;&lt;SPAN&gt;.search(&lt;/SPAN&gt;&lt;SPAN&gt;query&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"categories:xxx")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;For some category names that have spaces in I had to replace the space with an underscore, eg for category name "xxx yyy" it only worked if I wrote it as&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;gis.content.search(query="categories:xxx_yyy")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 04 Aug 2023 11:02:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/gis-content-search-with-categories/m-p/1315454#M8910</guid>
      <dc:creator>amitchinson</dc:creator>
      <dc:date>2023-08-04T11:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: gis.content.search with categories</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/gis-content-search-with-categories/m-p/1573885#M11020</link>
      <description>&lt;P&gt;Hi, I recently struggled with item search in AGOL and found this topic, which helped me to figure it out a way to search for cetegorized items (thanks!).&lt;/P&gt;&lt;P&gt;I've managed to search categories with spaces in their names using a combination of simple quotes (') and double quotes ("), like this:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;GIS&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;content&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;search&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;query&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;'categories: "Category Name with spaces"'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;max_items&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;5000&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 09 Jan 2025 13:41:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/gis-content-search-with-categories/m-p/1573885#M11020</guid>
      <dc:creator>MarceloOtte</dc:creator>
      <dc:date>2025-01-09T13:41:34Z</dc:date>
    </item>
  </channel>
</rss>

