<?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: Search Widget Dropdown Suggestions - Only Ones That &amp;quot;Start With&amp;quot; The Search Term in ArcGIS JavaScript Maps SDK Videos</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-videos/search-widget-dropdown-suggestions-only-ones-that/m-p/1021396#M16</link>
    <description>&lt;P&gt;Thanks for the suggestion, Noah.&amp;nbsp; Could you be more specific?&amp;nbsp; I tried out a lot of things using prefix and suffix, but that didn't get me anywhere.&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;U&gt;Without setting prefix or suffix in the layerSearchSource:&lt;/U&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I looked at the REST URL query through Chrome's Network tab.&amp;nbsp; It looks as though it is already using the LIKE operator and putting on '%' as a prefix and suffix:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;...&amp;amp;where=(UPPER(MailAddLine)%20LIKE%20%27%25SEARCH TERM%25%27)...&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;i.e., ...&amp;amp;where=(UPPER(MailAddLine) LIKE '%SEARCH TERM%')...&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I would just like to remove the first %:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;i.e., ...&amp;amp;where=(UPPER(MailAddLine) LIKE 'SEARCH TERM%')...&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Jan 2021 05:23:57 GMT</pubDate>
    <dc:creator>DaveFullerton</dc:creator>
    <dc:date>2021-01-29T05:23:57Z</dc:date>
    <item>
      <title>Search Widget Dropdown Suggestions - Only Ones That "Start With" The Search Term</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-videos/search-widget-dropdown-suggestions-only-ones-that/m-p/1020369#M13</link>
      <description>&lt;P&gt;I am using a feature layer search source with the Search Widget.&amp;nbsp; The feature layer contains address points that have addresses with apartment numbers.&amp;nbsp; There are some single digit address numbers, such as 8 Wyclow St.&amp;nbsp; When users enter 8 into the input box, the top 6 suggestions do not include 8 Wyclow St or even, for example, 8000 Main St.&amp;nbsp; Instead the top suggestions presented are addresses with the character '8' elsewhere in the address text.&lt;/P&gt;&lt;P&gt;Here the suggestions for '8':&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 210px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/4639i864E2F29396A6E2D/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here are the suggestions for '8 ':&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 184px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/4640iD34ECBC48953F2CA/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And for '8 W':&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 168px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/4641iC8F4A73110725937/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is there a way to set the Search Widget or Layer Search Source to limit the search using the like operator so that the query would be &amp;lt;searchField&amp;gt; like '&amp;lt;searchTerm&amp;gt;%'?&lt;/P&gt;&lt;P&gt;My LayerSearchSource Properties:&lt;/P&gt;&lt;P&gt;searchFields: ["MailAddLine"],&lt;BR /&gt;displayField: "MailAddLine",&lt;BR /&gt;exactMatch: true,&lt;BR /&gt;outFields: ["*"],&lt;BR /&gt;name: "JOCO Address Points",&lt;BR /&gt;placeholder: "Enter Address",&lt;BR /&gt;maxResults: 6,&lt;BR /&gt;maxSuggestions: 6,&lt;BR /&gt;suggestionsEnabled: true,&lt;BR /&gt;minSuggestCharacters: 0,&lt;BR /&gt;zoomScale: 1000,&lt;BR /&gt;orderByFields: ["MailAddLine"]&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 04:39:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-videos/search-widget-dropdown-suggestions-only-ones-that/m-p/1020369#M13</guid>
      <dc:creator>DaveFullerton</dc:creator>
      <dc:date>2021-01-27T04:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: Search Widget Dropdown Suggestions - Only Ones That "Start With" The Search Term</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-videos/search-widget-dropdown-suggestions-only-ones-that/m-p/1021333#M15</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/36532"&gt;@DaveFullerton&lt;/a&gt;, great question. We do have prefix and suffix properties on the LayerSearchSource, perhaps these would be helpful here?&lt;/P&gt;&lt;P&gt;prefix&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.html#prefix" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.html#prefix&lt;/A&gt;&lt;/P&gt;&lt;P&gt;suffix&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.html#suffix" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.html#suffix&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 23:04:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-videos/search-widget-dropdown-suggestions-only-ones-that/m-p/1021333#M15</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2021-01-28T23:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: Search Widget Dropdown Suggestions - Only Ones That "Start With" The Search Term</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-videos/search-widget-dropdown-suggestions-only-ones-that/m-p/1021396#M16</link>
      <description>&lt;P&gt;Thanks for the suggestion, Noah.&amp;nbsp; Could you be more specific?&amp;nbsp; I tried out a lot of things using prefix and suffix, but that didn't get me anywhere.&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;U&gt;Without setting prefix or suffix in the layerSearchSource:&lt;/U&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I looked at the REST URL query through Chrome's Network tab.&amp;nbsp; It looks as though it is already using the LIKE operator and putting on '%' as a prefix and suffix:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;...&amp;amp;where=(UPPER(MailAddLine)%20LIKE%20%27%25SEARCH TERM%25%27)...&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;i.e., ...&amp;amp;where=(UPPER(MailAddLine) LIKE '%SEARCH TERM%')...&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I would just like to remove the first %:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;i.e., ...&amp;amp;where=(UPPER(MailAddLine) LIKE 'SEARCH TERM%')...&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 05:23:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-videos/search-widget-dropdown-suggestions-only-ones-that/m-p/1021396#M16</guid>
      <dc:creator>DaveFullerton</dc:creator>
      <dc:date>2021-01-29T05:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: Search Widget Dropdown Suggestions - Only Ones That "Start With" The Search Term</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-videos/search-widget-dropdown-suggestions-only-ones-that/m-p/1031035#M18</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/169842"&gt;@Noah-Sager&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I tried use&amp;nbsp;&lt;SPAN&gt;LayerSearchSource.prefix and&amp;nbsp;suffix, but it seems those&amp;nbsp;properties aren't suitable&amp;nbsp;to "Starts with"-like search, because search term for "where" expression&amp;nbsp;in that case just concatenated&amp;nbsp;with&amp;nbsp;prefix/suffix AND "%" symbol&amp;nbsp;on BOTH sides.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here is my try based on &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/widgets-search-multiplesource/" target="_self"&gt;"Search widget with multiple sources"&lt;/A&gt;&amp;nbsp;(ArcGIS JS API v4.18)&lt;/SPAN&gt;:&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/alexader2021/pen/PobQRYJ?editors=1000" target="_blank" rel="noopener"&gt;https://codepen.io/alexader2021/pen/PobQRYJ?editors=1000&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;- as you can see, I set&amp;nbsp;&lt;SPAN&gt;prefix/suffix properties as "FOO"/"BAR" for first search source, and ONLY suffix "%" for the second one. Here are queries that I see in network:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Alexandr_1-1614358768845.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/7066iE2A689403FFB04DA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Alexandr_1-1614358768845.png" alt="Alexandr_1-1614358768845.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Alexandr_2-1614358901836.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/7069iFB786C638BD7AD88/image-dimensions/400x65?v=v2" width="400" height="65" role="button" title="Alexandr_2-1614358901836.png" alt="Alexandr_2-1614358901836.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Another words, search term is always &lt;SPAN&gt;surrounded with "%" symbol irrespectively&amp;nbsp;to&amp;nbsp;prefix/suffix.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Is there any way to implement "Starts with" search behavior, so that search term ends with "%", but not starts with?&lt;/P&gt;&lt;P&gt;Thank you for advance!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 17:15:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-videos/search-widget-dropdown-suggestions-only-ones-that/m-p/1031035#M18</guid>
      <dc:creator>Alexandr</dc:creator>
      <dc:date>2021-02-26T17:15:00Z</dc:date>
    </item>
  </channel>
</rss>

