Options that can be passed into tasks/search/SearchService!SearchService.search.

interface SearchOptions {
    cancelToken?: CancelToken;
    currentScale?: number;
    initialSearchArea?: GeometryUnion;
    locale?: string;
    maxAllowableOffset?: number;
    maxQueryResults?: number;
    maxResults?: number;
    maxSuggestions?: number;
    near?: Point;
    onSourceComplete?: ((result: TaskResult) => void);
    outSpatialReference?: SpatialReference;
    returnGeometry?: boolean;
    tokenizeSearchString?: boolean;
}

Properties

cancelToken?: CancelToken

An optional cancel token from a support/Cancellable!Cancellable that can be used to cancel the search.

currentScale?: number

Indicates the current scale of the supplied search area. If not provided the search area is limited to the initial search area.

initialSearchArea?: GeometryUnion

Initial search area. If possible the search area will be expanded until the maximum number of results are fulfilled.

locale?: string

The user's locale. Affects how numbers and other locale-specific values in the search text are interpreted. If not specified, the current global locale is used (see "locale" module).

maxAllowableOffset?: number

The maximum allowable offset used for generalizing geometries returned by the query operation.

maxQueryResults?: number

The maximum number of results to return from a query.

maxResults?: number

The maximum number of results to return.

maxSuggestions?: number

The maximum number of suggestions to return when performing a suggest operation.

near?: Point

If specified, this will influence the score of spatial features based on their proximity to this point. Most commonly this would be the user's current location, but can be any point of interest. This option requires spatialFilter to also be specified.

onSourceComplete?: ((result: TaskResult) => void)

An optional callback that will be invoked with additional information about the tasks's result for each source.

outSpatialReference?: SpatialReference

The spatial reference for the returned geometry.

returnGeometry?: boolean

Whether geometry for features should be returned.

tokenizeSearchString?: boolean

Indicates if the search string should be tokenized (in supported search providers). Tokenization of the search term will provide broader results including partial matches that may not be desirable in all scenarios. Defaults to 'true'.