Select to view content in your preferred language

Multiple Search Source not firing

2957
7
Jump to solution
10-29-2015 01:26 PM
MatthewBaker2
Deactivated User

All, I'm trying to get the Search multiple sources | ArcGIS API for JavaScript  sample to work, not sure why when I choose my search source, nothing happens..

- my search source is a point feature layer on an external server:

https://gisprod.dpsk12.org/arcgis/rest/services/address_master/FeatureServer/0

My code looks like this:

sources.push({featureLayer: new FeatureLayer("https://gisprod.dpsk12.org/arcgis/rest/services/address_master/FeatureServer/0"),
            searchFields: ["ADDRESS"],
            displayField: "ADDRESS",
            exactMatch: false,
            outFields: ["*"],
            name: "DPS Address",
            placeholder: "123 Smith St",
            maxResults: 6,
            maxSuggestions: 6,

            //Create an InfoTemplate and include three fields
            infoTemplate: new InfoTemplate("Address: ${ADDRESS}"),
            enableSuggestions: true,
            minCharacters: 0
         });

(I have also attached the html file I'm working on.)

Which looks good to me.

But when I use *just* my source, or use *all sources*, no network traffic is generated for my source when input text is entered - but I can see the traffic generated for the other sources (ESRI World Geocoder and Congressional Districts) I've left in the app.

The only thing I can figure is I haven't added feature templates, but hoping that isn't required...?

Thank you!

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
TracySchloss
Honored Contributor

If you're searching on attributes, as opposed to geocoding, the service has to be authored in version 10.3.  It looks to me like you're searching in the data for an address, but not necessarily geocoding?

View solution in original post

7 Replies
RickeyFight
MVP Regular Contributor

Matthew,

I got it to work with your code. I searched and found 19951 E 59th Dr using only your service.  I could not get your search to work with ALL selected though.

0 Kudos
MatthewBaker2
Deactivated User

Really? I can't get it to fire at all...

0 Kudos
RickeyFight
MVP Regular Contributor

Try :Edit fiddle - JSFiddle

I did not change your code at all.

0 Kudos
TracySchloss
Honored Contributor

If you're searching on attributes, as opposed to geocoding, the service has to be authored in version 10.3.  It looks to me like you're searching in the data for an address, but not necessarily geocoding?

MatthewBaker2
Deactivated User

Right - not geocoding, searching for an existing address then leaning on the ESRI geocoder for anything not in our file...

I hope that 10.3 stipulation isn't the hangup... we have no plans to upgrade any time soon...

0 Kudos
TracySchloss
Honored Contributor

  It's not real clear in the documentation, but it does tell you in the API help for Search that it requires 10.3.

Suggestions are available if working with a 10.3 geocoding service that has suggest capability loaded or a 10.3 feature layer that supports pagination, i.e. supportsPagination = true.

It seems like when I looked into this, 'supportsPagination' is only available starting at 10.3 and not something you can create in the earlier versions.   I'm not crazy about having to upgrade either, but this is the sort of functionality that makes me want to do it sooner rather than later.  Thankfully the upgrade process isn't quite as painful as it used to be.

MatthewBaker2
Deactivated User

I'll have to roll with that for now... thank you!!!

0 Kudos