Select to view content in your preferred language

Search popup only shows three fields

2427
5
Jump to solution
01-19-2016 11:49 AM
TylerDunn2
Occasional Contributor

Not sure if this is a default or not, but when I get my search results, only three fields show up. Regardless of how many I have set in my index.

Am I missing something? below is the code for the search:

    sources.push({

      featureLayer: new FeatureLayer("https://gis.cityofthornton.net/arcgis/rest/services/External_Webmaps/MasterAddress/MapServer/0 "),

      searchFields: ["ADDRESS"],

      displayField: "ADDRESS",

      suggestionTemplate: "${ADDRESS}",

      exactMatch: false,

      outFields: ["PT_TYPE", "ADDRESS", "CITY", "STATE", "ZIPCODE", "BUS_NAME", "BUS_TYPE", "LANDUSE", "ZONING", "WARD", "SUBDIVISIO", "DEV_NAME"],

      infoTemplate: new InfoTemplate("Address: ${ADDRESS}", "Address Type: ${PT_TYPE}</br>Address: ${ADDRESS}</br>City: ${CITY}", "State: ${STATE}</br>Zipcode: ${ZIPCODE}","Business Name: ${BUS_NAME}</br>Business Type: ${BUS_TYPE}</br>Landuse: ${LANDUSE}", "Zoning: ${ZONING}</br>Ward: ${WARD}", "Subdivision Name: ${SUBDIVISIO}</br>Development Name: ${DEV_NAME}"),

      name: "Address Search",

      placeholder: "Search Addresses",

      maxResults: 6,

      maxSuggestions: 6,

      enableSuggestions: true,

      minCharacters: 0

    });

   

    s.set("sources", sources);

    s.startup();

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
GirishYadav
Occasional Contributor

Tyler,

The infoTemplate that you are creating does not have correct parameters. It takes only two parameters (title, content). There are extra "," inside contents:

infoTemplate: new InfoTemplate("Address: ${ADDRESS}", "Address Type: ${PT_TYPE}</br>Address: ${ADDRESS}</br>City: ${CITY}", "State: ${STATE}</br>Zipcode: ${ZIPCODE}","Business Name: ${BUS_NAME}</br>Business Type: ${BUS_TYPE}</br>Landuse: ${LANDUSE}", "Zoning: ${ZONING}</br>Ward: ${WARD}", "Subdivision Name: ${SUBDIVISIO}</br>Development Name: ${DEV_NAME}"),

Use it like this:

new InfoTemplate("Search Results", "Address: ${ADDRESS}</br>Address Type: ${PT_TYPE}</br>Address: ${ADDRESS}</br>City: ${CITY}</br>State: ${STATE}</br>Zipcode: ${ZIPCODE}</br>Business Name: ${BUS_NAME}</br>Business Type: ${BUS_TYPE}</br>Landuse: ${LANDUSE}</br>Zoning: ${ZONING}</br>Ward: ${WARD}</br>Subdivision Name: ${SUBDIVISIO}</br>Development Name: ${DEV_NAME}"),

-Girish

View solution in original post

5 Replies
TiffanySelvidge1
Occasional Contributor III

Is it always the same 3 fields?

0 Kudos
TylerDunn2
Occasional Contributor

Yeah it's always those first three. Here's a screen shot:

0 Kudos
TiffanySelvidge1
Occasional Contributor III

What happens if you separate ${CITY} and State with a </br>?

infoTemplate: new InfoTemplate("Address: ${ADDRESS}", "Address Type: ${PT_TYPE}</br>Address: ${ADDRESS}</br>City: ${CITY}", "State: ${STATE}</br>Zipcode: ${ZIPCODE}","Business Name: ${BUS_NAME}</br>Business Type: ${BUS_TYPE}</br>Landuse: ${LANDUSE}", "Zoning: ${ZONING}</br>Ward: ${WARD}", "Subdivision Name: ${SUBDIVISIO}</br>Development Name: ${DEV_NAME}"),

0 Kudos
TylerDunn2
Occasional Contributor

Even with it fixed for correct breaks, it doesn't work: Thanks for trying to problem solve with me

    sources.push({

      featureLayer: new FeatureLayer("https://gis.cityofthornton.net/arcgis/rest/services/External_Webmaps/MasterAddress/MapServer/0"),

      searchFields: ["ADDRESS"],

      displayField: "ADDRESS",

      suggestionTemplate: "${ADDRESS}",

      exactMatch: false,

      outFields: ["PT_TYPE", "ADDRESS", "CITY", "STATE", "ZIPCODE", "BUS_NAME", "BUS_TYPE", "LANDUSE", "ZONING", "WARD", "SUBDIVISIO", "DEV_NAME"],

      infoTemplate: new InfoTemplate("<b>Address: ${ADDRESS}</b>", "<b>Address Type: ${PT_TYPE}</br>","<b>Address: ${ADDRESS}</br>","<b>City: ${CITY}</b>", "<b>State: ${STATE}</br>","<b>Zipcode: ${ZIPCODE}</b>","<b>Business Name: ${BUS_NAME}</br>","<b>Business Type: ${BUS_TYPE}</br>","<b>Landuse: ${LANDUSE}</b>", "<b>Zoning: ${ZONING}</br>","<b>Ward: ${WARD}</b>", "<b>Subdivision Name: ${SUBDIVISIO}</br>","<b>Development Name: ${DEV_NAME}</b>"),

      name: "Owner Search",

      placeholder: "Search Owners",

      maxResults: 6,

      maxSuggestions: 6,

      enableSuggestions: true,

      minCharacters: 0

    });

  

    s.set("sources", sources);

    s.startup();

0 Kudos
GirishYadav
Occasional Contributor

Tyler,

The infoTemplate that you are creating does not have correct parameters. It takes only two parameters (title, content). There are extra "," inside contents:

infoTemplate: new InfoTemplate("Address: ${ADDRESS}", "Address Type: ${PT_TYPE}</br>Address: ${ADDRESS}</br>City: ${CITY}", "State: ${STATE}</br>Zipcode: ${ZIPCODE}","Business Name: ${BUS_NAME}</br>Business Type: ${BUS_TYPE}</br>Landuse: ${LANDUSE}", "Zoning: ${ZONING}</br>Ward: ${WARD}", "Subdivision Name: ${SUBDIVISIO}</br>Development Name: ${DEV_NAME}"),

Use it like this:

new InfoTemplate("Search Results", "Address: ${ADDRESS}</br>Address Type: ${PT_TYPE}</br>Address: ${ADDRESS}</br>City: ${CITY}</br>State: ${STATE}</br>Zipcode: ${ZIPCODE}</br>Business Name: ${BUS_NAME}</br>Business Type: ${BUS_TYPE}</br>Landuse: ${LANDUSE}</br>Zoning: ${ZONING}</br>Ward: ${WARD}</br>Subdivision Name: ${SUBDIVISIO}</br>Development Name: ${DEV_NAME}"),

-Girish