# Interface SearchOptions

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;
}

#####
Index

### Properties

cancelToken?
currentScale?
initialSearchArea?
locale?
maxAllowableOffset?
maxQueryResults?
maxResults?
maxSuggestions?
near?
onSourceComplete?
outSpatialReference?
returnGeometry?
tokenizeSearchString?

##
Properties

### `Optional` cancelToken

cancelToken?: CancelToken

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

### `Optional` currentScale

currentScale?: number

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

### `Optional` initialSearchArea

initialSearchArea?: GeometryUnion

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

### `Optional` locale

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).

### `Optional` maxAllowableOffset

maxAllowableOffset?: number

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

### `Optional` maxQueryResults

maxQueryResults?: number

The maximum number of results to return from a query.

### `Optional` maxResults

maxResults?: number

The maximum number of results to return.

### `Optional` maxSuggestions

maxSuggestions?: number

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

### `Optional` near

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.

### `Optional` onSourceComplete

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

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

### `Optional` outSpatialReference

outSpatialReference?: SpatialReference

The spatial reference for the returned geometry.

### `Optional` returnGeometry

returnGeometry?: boolean

Whether geometry for features should be returned.

### `Optional` tokenizeSearchString

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'.