<?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: Content Manager hosted table search gives no result in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/content-manager-hosted-table-search-gives-no/m-p/1057698#M6060</link>
    <description>&lt;P&gt;Owner is &lt;EM&gt;also&lt;/EM&gt; a query string parameter.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;gis.content.search('typekeywords:table owner:carlsonj9')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 13 May 2021 16:43:26 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2021-05-13T16:43:26Z</dc:date>
    <item>
      <title>Content Manager hosted table search gives no result</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/content-manager-hosted-table-search-gives-no/m-p/1057324#M6049</link>
      <description>&lt;P&gt;Is there a way to search your Enterprise Portal for a hosted table using the &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html?highlight=item_type%20table#arcgis.gis.ContentManager.search" target="_self"&gt;content manager search()&lt;/A&gt;? I've tried a few different ways using the &lt;EM&gt;item_type= &lt;/EM&gt;parameter, but I get nothing. And there is no obvious mention of tables in the &lt;A href="https://developers.arcgis.com/rest/users-groups-and-items/items-and-item-types.htm" target="_self"&gt;Items and item types&lt;/A&gt; API help page?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;table = gis.content.search(query="title:csvtest", item_type='table')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've also tried these:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;item_type='hosted table'
item_type='Table'
item_type='Table Layer'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;They all give me this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;[]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is, however, a table in my content. I can find it with the required query parameter alone. The item type will come back as &lt;EM&gt;Table Layer&lt;/EM&gt;, which, as you see above, I have tried.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;table = gis.content.search(query="title:csvtest")

###result
&amp;lt;Item title:"csvtest" type:Table Layer owner:admin&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 May 2021 19:22:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/content-manager-hosted-table-search-gives-no/m-p/1057324#M6049</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2021-05-12T19:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Content Manager hosted table search gives no result</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/content-manager-hosted-table-search-gives-no/m-p/1057353#M6050</link>
      <description>&lt;P&gt;When you call Item.type on a table, you get 'Feature Service'. Specifying that in the item_type parameter will return table layers, too.&lt;/P&gt;&lt;P&gt;However, there does seem to be some separate attribute being stored somewhere that identifies the service as a table, but where? If you look at the service JSON, you'll see something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;{
...
  "type" : "Feature Service", 
  "typeKeywords" : [
    "ArcGIS Server", 
    "Data", 
    "Feature Access", 
    "Feature Service", 
    "Service", 
    "Table", 
    "Hosted Service"
  ],
...
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Refer to the &lt;A href="https://developers.arcgis.com/rest/users-groups-and-items/search-reference.htm" target="_self"&gt;search reference&lt;/A&gt; page, and you'll see that 'typekeywords' is its own search parameter, and goes in the &lt;STRONG&gt;query string&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# This works
gis.content.search('table')

# This is more specific, and probably better
gis.content.search('typekeywords:table')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both&amp;nbsp; commands return:&lt;/P&gt;&lt;PRE&gt;[&amp;lt;Item title:"Join_Features_to_GISFIPSMG" type:Table Layer owner:carlsonj9&amp;gt;,&lt;BR /&gt;&amp;lt;Item title:"date test" type:Table Layer owner:carlsonj9&amp;gt;,&lt;BR /&gt;&amp;lt;Item title:"GISFIPSMG" type:Table Layer owner:carlsonj9&amp;gt;]&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;EDIT: It looks like the &lt;A href="https://developers.arcgis.com/rest/users-groups-and-items/items-and-item-types.htm" target="_self"&gt;items and item types page&lt;/A&gt; does not reference tables in type or typekeyword, so you'd be forgiven for not being able to find this information. I've sent feedback for the page to get updated.&lt;/P&gt;</description>
      <pubDate>Wed, 12 May 2021 20:01:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/content-manager-hosted-table-search-gives-no/m-p/1057353#M6050</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-05-12T20:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: Content Manager hosted table search gives no result</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/content-manager-hosted-table-search-gives-no/m-p/1057684#M6057</link>
      <description>&lt;P&gt;Josh,&lt;/P&gt;&lt;P&gt;Thanks for the reply. I was able to get back the table I was searching for:&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;table = gis.content.search("typekeywords:table")
table

#out[]: &amp;lt;Item title:"csvtest" type:Table Layer owner:admin
...

#this also worked
table = gis.content.search(query="typekeywords:table")&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;&lt;P&gt;However, that also returns every other table owned by &lt;EM&gt;admin&lt;/EM&gt;. There are seven.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tab.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/13268iF2E2D5E03F007B44/image-size/large?v=v2&amp;amp;px=999" role="button" title="tab.png" alt="tab.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to single out my table. And using the &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html?highlight=item_type%20table#arcgis.gis.ContentManager.search" target="_self"&gt;other parameters&lt;/A&gt; doesn't seem to do anything. For example, this will return all the tables under admin.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;table = gis.content.search("typekeywords:table", sort_field='csvtest')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've considered using an index number &lt;EM&gt;[0] &lt;/EM&gt;to find the item, but that can be slippery as my colleagues also add content to the Portal with the admin sign-in. So, it might be &lt;EM&gt;[0]&lt;/EM&gt; one day but not the next.&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 16:29:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/content-manager-hosted-table-search-gives-no/m-p/1057684#M6057</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2021-05-13T16:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Content Manager hosted table search gives no result</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/content-manager-hosted-table-search-gives-no/m-p/1057689#M6058</link>
      <description>&lt;P&gt;&lt;A href="https://developers.arcgis.com/rest/users-groups-and-items/search-reference.htm" target="_self"&gt;This&lt;/A&gt; isn't very encouraging:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"Care should be taken when using ArcGIS REST API search operations... The Portal uses a powerful search engine to index information and to allow full text searching on it. This search engine uses many different inputs to find the appropriate results and rank them. This often makes search 'fuzzy', making it ideal for human interaction, but not necessarily ideal for looking for specific records programmatically. Developers should avoid using search to find specific items (e.g. by title) as the results of these types of queries might change as the search engine evolves."&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 16:35:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/content-manager-hosted-table-search-gives-no/m-p/1057689#M6058</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2021-05-13T16:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: Content Manager hosted table search gives no result</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/content-manager-hosted-table-search-gives-no/m-p/1057695#M6059</link>
      <description>&lt;P&gt;Ay caramba. I try to stick with "gis.content.get('itemid')" for that reason.&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 16:41:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/content-manager-hosted-table-search-gives-no/m-p/1057695#M6059</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-05-13T16:41:32Z</dc:date>
    </item>
    <item>
      <title>Re: Content Manager hosted table search gives no result</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/content-manager-hosted-table-search-gives-no/m-p/1057698#M6060</link>
      <description>&lt;P&gt;Owner is &lt;EM&gt;also&lt;/EM&gt; a query string parameter.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;gis.content.search('typekeywords:table owner:carlsonj9')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 16:43:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/content-manager-hosted-table-search-gives-no/m-p/1057698#M6060</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-05-13T16:43:26Z</dc:date>
    </item>
  </channel>
</rss>

