FeatureLayerSearchSource

require(["esri/widgets/Search/FeatureLayerSearchSource"], function(FeatureLayerSearchSource) { /* code goes here */ });
Class: esri/widgets/Search/FeatureLayerSearchSource
Inheritance: FeatureLayerSearchSource SearchSource
Since: ArcGIS API for JavaScript 4.0

The following properties define a FeatureLayer-based source whose features may be searched by a Search widget instance.

Feature layers created from client-side graphics are not supported.

See also:

Constructors

new FeatureLayerSearchSource(properties)
Parameter:
properties Object
optional

See the properties for a list of all the properties that may be passed into the constructor.

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
NameTypeSummaryClass
Boolean

Indicates whether to automatically navigate to the selected result once selected.

more details
more detailsSearchSource
String

The results are displayed using this field.

more details
more detailsFeatureLayerSearchSource
Boolean

Indicates to only return results that match the search value exactly.

more details
more detailsFeatureLayerSearchSource
FeatureLayer

The feature layer queried in the search.

more details
more detailsFeatureLayerSearchSource
Object

This property replaces the now deprecated searchQueryParams, suggestQueryParams, and searchExtent properties.

more details
more detailsSearchSource
Number

Indicates the maximum number of search results to return.

more details
more detailsSearchSource
Number

Indicates the maximum number of suggestions to return for the widget's input.

more details
more detailsSearchSource
Number

Indicates the minimum number of characters required before querying for a suggestion.

more details
more detailsSearchSource
String

The name of the source for display.

more details
more detailsFeatureLayerSearchSource
String[]

Specifies the fields returned with the search results.

more details
more detailsSearchSource
String

Used as a hint for the source input text.

more details
more detailsSearchSource
Boolean

Indicates whether to display a Popup when a selected result is clicked.

more details
more detailsSearchSource
PopupTemplate

The popup template used to display search results.

more details
more detailsSearchSource
String

Specify this to prefix the user's input of the search text.

more details
more detailsSearchSource
Boolean

Indicates whether to show a graphic on the map for the selected source using the resultSymbol.

more details
more detailsSearchSource
Symbol

The symbol used to display the result.

more details
more detailsSearchSource
String[]

An array of string values representing the names of fields in the feature layer to search.

more details
more detailsFeatureLayerSearchSource
String

A template string used to display multiple fields in a defined order when results are displayed.

more details
more detailsFeatureLayerSearchSource
String

Specify this to add a suffix to the user's input for the search value.

more details
more detailsSearchSource
Boolean

Indicates whether to display suggestions as the user enters input text in the widget.

more details
more detailsSearchSource
String

A template string used to display multiple fields in a defined order when suggestions are displayed.

more details
more detailsFeatureLayerSearchSource
Boolean

Indicates whether to constrain the search results to the view's extent.

more details
more detailsSearchSource
Number

The set zoom scale for the resulting search result.

more details
more detailsSearchSource

Property Details

autoNavigateBoolean inherited

Indicates whether to automatically navigate to the selected result once selected.

Default Value:true
displayFieldString

The results are displayed using this field. Defaults to the layer's displayField or the first string field.

exactMatchBoolean

Indicates to only return results that match the search value exactly. This property only applies to string field searches. exactMatch is always true when searching fields of type number.

Default Value:false
featureLayerFeatureLayer

The feature layer queried in the search. This is required.

Feature layers created from client-side graphics are not supported.

Since: ArcGIS API for JavaScript 4.4

This property replaces the now deprecated searchQueryParams, suggestQueryParams, and searchExtent properties. Please see the object specification table below for details.

Properties:
where String
optional

The where clause specified for filtering suggests or search results.

geometry Geometry
optional

The filter geometry for suggests or search results.

maxResultsNumber inherited

Indicates the maximum number of search results to return.

Default Value:6
maxSuggestionsNumber inherited

Indicates the maximum number of suggestions to return for the widget's input.

Default Value:6
minSuggestCharactersNumber inherited

Indicates the minimum number of characters required before querying for a suggestion.

Default Value:1
nameString

The name of the source for display.

Specifies the fields returned with the search results.

placeholderString inherited

Used as a hint for the source input text.

popupEnabledBoolean inherited

Indicates whether to display a Popup when a selected result is clicked.

The popup template used to display search results. If no popup is needed, set the source's popupTemplate to null.

This property should be set in instances where there is no existing PopupTemplate configured. For example, feature sources will default to any existing popupTemplate configured on the layer.

Specify this to prefix the user's input of the search text.

resultGraphicEnabledBoolean inherited

Indicates whether to show a graphic on the map for the selected source using the resultSymbol.

resultSymbolSymbol inherited

The symbol used to display the result.

searchFieldsString[]

An array of string values representing the names of fields in the feature layer to search.

searchTemplateString

A template string used to display multiple fields in a defined order when results are displayed.

Example:
featureLayerSource.searchTemplate = "{County}, {State}";

Specify this to add a suffix to the user's input for the search value.

suggestionsEnabledBoolean inherited

Indicates whether to display suggestions as the user enters input text in the widget.

Default Value:true
suggestionTemplateString

A template string used to display multiple fields in a defined order when suggestions are displayed. This takes precedence over displayField. Field names in the template must have the following format: {FieldName}. An example suggestionTemplate could look something like: Name: {OWNER}, Parcel: {PARCEL_ID}.

Example:
featureLayerSource.suggestionTemplate = "Name: {OWNER}, Parcel: {PARCEL_ID}";
withinViewEnabledBoolean inherited

Indicates whether to constrain the search results to the view's extent.

Default Value:false
zoomScaleNumber inherited

The set zoom scale for the resulting search result. This scale is automatically honored.

Method Overview

NameReturn TypeSummaryClass
FeatureLayerSearchSource

Creates a deep clone of this object.

more details
more detailsFeatureLayerSearchSource
*

Creates a new instance of this class and initializes it with values from a JSON object generated from a product in the ArcGIS platform.

more details
more detailsFeatureLayerSearchSource
Object

Converts an instance of this class to its ArcGIS portal JSON representation.

more details
more detailsFeatureLayerSearchSource

Method Details

Creates a deep clone of this object.

Returns:
TypeDescription
FeatureLayerSearchSourceA clone of the new FeatureLayerSearchSource instance.
fromJSON(json){*}static

Creates a new instance of this class and initializes it with values from a JSON object generated from a product in the ArcGIS platform. The object passed into the input json parameter often comes from a response to a query operation in the REST API or a toJSON() method from another ArcGIS product. See the Using fromJSON() topic in the Guide for details and examples of when and how to use this function.

Parameter:
json Object

A JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects.

Returns:
TypeDescription
*Returns a new instance of this class.
toJSON(){Object}

Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() topic in the Guide for more information.

Returns:
TypeDescription
ObjectThe ArcGIS portal JSON representation of an instance of this class.

API Reference search results

NameTypeModule
Loading...