<?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: Find items with exact title using content.search in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-items-with-exact-title-using-content-search/m-p/760084#M401</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you would like to sort results by whether they contain some exact string, but the string does not necessarily have to make up the entire title, you can try something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;boston_data =&amp;nbsp;gis.content.search(query = "title:Boston",&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;item_type='Feature Layer',&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;max_items=1000,&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;outside_org=True)&lt;/P&gt;&lt;P&gt;for item in boston_data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if "Boston" in str(item.title):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;display(item)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;else:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pass&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will return only results that have the word "Boston" in them, but not limit your search results to titles that are exactly "Boston".&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Mar 2020 15:32:52 GMT</pubDate>
    <dc:creator>EduardoBarrera</dc:creator>
    <dc:date>2020-03-10T15:32:52Z</dc:date>
    <item>
      <title>Find items with exact title using content.search</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-items-with-exact-title-using-content-search/m-p/760080#M397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-top: 0px !important; margin-bottom: 16px;"&gt;Using the arcgis python API, is it possible to restrict search results to exact matches by title?&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-bottom: 0px !important;"&gt;My query is title:City_Boundaries and owner:username and the search is returning other "City_Boundary" matches and would like to restrict to exact matches.&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-bottom: 0px !important;"&gt;&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-bottom: 0px !important;"&gt;I reviewed this search documentation and could not find anything related to exact matches&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-bottom: 0px !important;"&gt;&lt;A class="link-titled" href="http://resources.arcgis.com/en/help/arcgis-rest-api/#/Search_reference/02r3000000mn000000/" title="http://resources.arcgis.com/en/help/arcgis-rest-api/#/Search_reference/02r3000000mn000000/"&gt;ArcGIS REST API&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Aug 2017 21:06:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/find-items-with-exact-title-using-content-search/m-p/760080#M397</guid>
      <dc:creator>RonnieRichards</dc:creator>
      <dc:date>2017-08-14T21:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: Find items with exact title using content.search</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-items-with-exact-title-using-content-search/m-p/760081#M398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had same issue. I&amp;nbsp; solved&amp;nbsp; the issue by adding&amp;nbsp; search&amp;nbsp;field&amp;nbsp; &amp;nbsp;as sort field and sorted on ascending order, then took the first one in the list. It worked for me. ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#you can try something like:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;item_to search ="your item to search"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;owner ="owner of the item"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; item=gis.content.search(query="title:"+&amp;nbsp;item_to search + " AND owner: " + owner, sort_field='title', sort_order='asc' )[0]&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Surendran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Oct 2017 19:10:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/find-items-with-exact-title-using-content-search/m-p/760081#M398</guid>
      <dc:creator>SurendranNeelakantan</dc:creator>
      <dc:date>2017-10-16T19:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: Find items with exact title using content.search</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-items-with-exact-title-using-content-search/m-p/760082#M399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree&amp;nbsp;you should&amp;nbsp;be able to search for an exact match. I want to search by the name, for example,&amp;nbsp;Golf_Course and get the ID so I can update it. Unfortunately, the first one it finds is a similarly named layer. Updating data requires an exact match, it seems strange that finding an exact match would not have been&amp;nbsp;the default&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please vote on the following idea to have an exact match option.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/ideas/15577" target="_blank"&gt;https://community.esri.com/ideas/15577&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jun 2021 08:46:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/find-items-with-exact-title-using-content-search/m-p/760082#M399</guid>
      <dc:creator>MelanieWawryk</dc:creator>
      <dc:date>2021-06-22T08:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: Find items with exact title using content.search</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-items-with-exact-title-using-content-search/m-p/760083#M400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Old but ran into this issue today.&amp;nbsp; You can add more logic after the content.search to workaround the limitation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;searchData=gis.content.search(query='title:{} AND owner:{}'.format(name,owner))&lt;/P&gt;&lt;P&gt;for search in searchData:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if search["title"]==name:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#match&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Oct 2019 15:09:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/find-items-with-exact-title-using-content-search/m-p/760083#M400</guid>
      <dc:creator>AndrewAdamson</dc:creator>
      <dc:date>2019-10-29T15:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: Find items with exact title using content.search</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-items-with-exact-title-using-content-search/m-p/760084#M401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you would like to sort results by whether they contain some exact string, but the string does not necessarily have to make up the entire title, you can try something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;boston_data =&amp;nbsp;gis.content.search(query = "title:Boston",&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;item_type='Feature Layer',&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;max_items=1000,&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;outside_org=True)&lt;/P&gt;&lt;P&gt;for item in boston_data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if "Boston" in str(item.title):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;display(item)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;else:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pass&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will return only results that have the word "Boston" in them, but not limit your search results to titles that are exactly "Boston".&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2020 15:32:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/find-items-with-exact-title-using-content-search/m-p/760084#M401</guid>
      <dc:creator>EduardoBarrera</dc:creator>
      <dc:date>2020-03-10T15:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: Find items with exact title using content.search</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-items-with-exact-title-using-content-search/m-p/760085#M402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Portal and AGOL use Elasticsearch under the hood to store item metadata. It’s meant to do fast full text searches and returns ‘hits’. Don’t expect exact searches.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Put more conditions to your query. Limit to your organization by passing an orgid or to a user. Drop max_items to 1 too.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 May 2020 22:35:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/find-items-with-exact-title-using-content-search/m-p/760085#M402</guid>
      <dc:creator>GeofyAdmin</dc:creator>
      <dc:date>2020-05-12T22:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: Find items with exact title using content.search</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-items-with-exact-title-using-content-search/m-p/1005757#M5259</link>
      <description>&lt;P&gt;Getting the same question, the&amp;nbsp;workaround&amp;nbsp; I'm using is &lt;STRONG&gt;list comprehension. &lt;/STRONG&gt;E.g :&lt;/P&gt;&lt;P&gt;searched_items=[item for item in gis. content.search(query="title: base_map", item_type="Map Service", max_items=20 if item.title=="base_map"]&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 04:36:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/find-items-with-exact-title-using-content-search/m-p/1005757#M5259</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-12-01T04:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: Find items with exact title using content.search</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-items-with-exact-title-using-content-search/m-p/1127393#M6919</link>
      <description>&lt;P&gt;@ESRI&amp;nbsp;how come this bug reported back to almost 5 years ago still not fixed. is it that hard or just not listening to your users. very disappointed&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Dec 2021 08:36:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/find-items-with-exact-title-using-content-search/m-p/1127393#M6919</guid>
      <dc:creator>JackFanZhang</dc:creator>
      <dc:date>2021-12-18T08:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: Find items with exact title using content.search</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-items-with-exact-title-using-content-search/m-p/1499817#M10270</link>
      <description>&lt;P&gt;Just what I was after! Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 13:45:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/find-items-with-exact-title-using-content-search/m-p/1499817#M10270</guid>
      <dc:creator>MattHowe</dc:creator>
      <dc:date>2024-07-01T13:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: Find items with exact title using content.search</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/find-items-with-exact-title-using-content-search/m-p/1591199#M11191</link>
      <description>&lt;P&gt;Thanks!&lt;BR /&gt;You're missing a closing parenthesis after max_items=20.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2025 14:27:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/find-items-with-exact-title-using-content-search/m-p/1591199#M11191</guid>
      <dc:creator>mikaël</dc:creator>
      <dc:date>2025-03-03T14:27:53Z</dc:date>
    </item>
  </channel>
</rss>

