<?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 Search widget on existing map layers? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-on-existing-map-layers/m-p/639093#M59683</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using v4.7 of the JavaScript API:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I add two feature layers to a map (sourced on .json data files). The layers show up fine, with the data expected, and selectable/deselectable using the LayersList widget.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try to setup the Search widget, both layers appear in the select&amp;nbsp;dropdown list ok, but when I enter some text to search I don't get any hits and the auto-suggestions are also not appearing. I think that&amp;nbsp;&lt;SPAN&gt;map.layers[0] and&amp;nbsp;map.layers[1]&lt;/SPAN&gt;&amp;nbsp;are not referencing the actual layers (I also tried &lt;SPAN&gt;map.layers[8] and&amp;nbsp;map.layers[9]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;- which don't exist - and got no errors)&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I look at the JavaScript console, and run a&lt;/P&gt;&lt;P&gt;console.log("Results of the search: ", event)&lt;/P&gt;&lt;P&gt;I see in Results / Source: &lt;STRONG&gt;featureLayer: undefined&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;but&amp;nbsp;&lt;/P&gt;&lt;P&gt;searchFields: ["name"] so (some of) the parameters sent below are getting through.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The fieldname to search in is "name". Any help to resolve this would be appreciated.&amp;nbsp;Here's the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var searchSources =[&lt;BR /&gt; { featureLayer: &lt;STRONG&gt;map.layers[0]&lt;/STRONG&gt;, searchFields: ["name"], displayField: "name", exactMatch: false, outFields: ["*"], name: "A search", placeholder: "A search", maxResults: 6, maxSuggestions: 6, suggestionsEnabled: true, minSuggestCharacters: 0 },&lt;BR /&gt; { featureLayer: &lt;STRONG&gt;map.layers[1]&lt;/STRONG&gt;, searchFields: ["name"], displayField: "name", exactMatch: false, outFields: ["*"], name: "B search", placeholder: "B search", maxResults: 6, maxSuggestions: 6, suggestionsEnabled: true, minSuggestCharacters: 0 }];&lt;BR /&gt; var search = new Search({ map: map, allPlaceholder: "Search A and B", sources: searchSources });&lt;BR /&gt; view.ui.add(search, {position: "top-right", });&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 May 2018 08:06:57 GMT</pubDate>
    <dc:creator>Shane_</dc:creator>
    <dc:date>2018-05-04T08:06:57Z</dc:date>
    <item>
      <title>Search widget on existing map layers?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-on-existing-map-layers/m-p/639093#M59683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using v4.7 of the JavaScript API:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I add two feature layers to a map (sourced on .json data files). The layers show up fine, with the data expected, and selectable/deselectable using the LayersList widget.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try to setup the Search widget, both layers appear in the select&amp;nbsp;dropdown list ok, but when I enter some text to search I don't get any hits and the auto-suggestions are also not appearing. I think that&amp;nbsp;&lt;SPAN&gt;map.layers[0] and&amp;nbsp;map.layers[1]&lt;/SPAN&gt;&amp;nbsp;are not referencing the actual layers (I also tried &lt;SPAN&gt;map.layers[8] and&amp;nbsp;map.layers[9]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;- which don't exist - and got no errors)&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I look at the JavaScript console, and run a&lt;/P&gt;&lt;P&gt;console.log("Results of the search: ", event)&lt;/P&gt;&lt;P&gt;I see in Results / Source: &lt;STRONG&gt;featureLayer: undefined&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;but&amp;nbsp;&lt;/P&gt;&lt;P&gt;searchFields: ["name"] so (some of) the parameters sent below are getting through.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The fieldname to search in is "name". Any help to resolve this would be appreciated.&amp;nbsp;Here's the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var searchSources =[&lt;BR /&gt; { featureLayer: &lt;STRONG&gt;map.layers[0]&lt;/STRONG&gt;, searchFields: ["name"], displayField: "name", exactMatch: false, outFields: ["*"], name: "A search", placeholder: "A search", maxResults: 6, maxSuggestions: 6, suggestionsEnabled: true, minSuggestCharacters: 0 },&lt;BR /&gt; { featureLayer: &lt;STRONG&gt;map.layers[1]&lt;/STRONG&gt;, searchFields: ["name"], displayField: "name", exactMatch: false, outFields: ["*"], name: "B search", placeholder: "B search", maxResults: 6, maxSuggestions: 6, suggestionsEnabled: true, minSuggestCharacters: 0 }];&lt;BR /&gt; var search = new Search({ map: map, allPlaceholder: "Search A and B", sources: searchSources });&lt;BR /&gt; view.ui.add(search, {position: "top-right", });&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 08:06:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-on-existing-map-layers/m-p/639093#M59683</guid>
      <dc:creator>Shane_</dc:creator>
      <dc:date>2018-05-04T08:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: Search widget on existing map layers?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-on-existing-map-layers/m-p/639094#M59684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;S C,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; So when you say:&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I add two feature layers to a map (sourced on .json data files)&lt;/BLOCKQUOTE&gt;&lt;P&gt;You mean they are not coming from AGOL or an ArcGIS Server? Are you meaning they com from an array of client side graphics?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 12:36:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-on-existing-map-layers/m-p/639094#M59684</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-05-04T12:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: Search widget on existing map layers?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-on-existing-map-layers/m-p/639095#M59685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, they're from&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;array of client side graphics&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 12:42:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-on-existing-map-layers/m-p/639095#M59685</guid>
      <dc:creator>Shane_</dc:creator>
      <dc:date>2018-05-04T12:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: Search widget on existing map layers?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-on-existing-map-layers/m-p/639096#M59686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The search widgets suggest and query functionality depends on the layer coming from ArcGIS Server or AGOL, so that is the issue.&lt;/P&gt;&lt;P&gt;Suggestions require the FL to support paginiation which a FL from graphics does not.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 12:54:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-on-existing-map-layers/m-p/639096#M59686</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-05-04T12:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: Search widget on existing map layers?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-on-existing-map-layers/m-p/639097#M59687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. But leaving suggestions aside, could the query at least return results from an&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;FL from graphics?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 13:18:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-on-existing-map-layers/m-p/639097#M59687</guid>
      <dc:creator>Shane_</dc:creator>
      <dc:date>2018-05-04T13:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Search widget on existing map layers?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-on-existing-map-layers/m-p/639098#M59688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not that I am aware of. The layer needs to be from ArcGIS Server or AGOL.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 13:24:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-on-existing-map-layers/m-p/639098#M59688</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-05-04T13:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Search widget on existing map layers?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-on-existing-map-layers/m-p/639099#M59689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Understood. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 13:29:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-on-existing-map-layers/m-p/639099#M59689</guid>
      <dc:creator>Shane_</dc:creator>
      <dc:date>2018-05-04T13:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: Search widget on existing map layers?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-on-existing-map-layers/m-p/639100#M59690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't forget to mark this question as answered by clicking on the "Mark Correct" link on the reply that answered your question.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 13:46:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-on-existing-map-layers/m-p/639100#M59690</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-05-04T13:46:17Z</dc:date>
    </item>
  </channel>
</rss>

