Namespace: API-Search

API-Search

Methods

(static) clearScrollApi(params, optionsopt, callbackopt) → {Object|Promise.<never>|*}

Close the search context when you’re done scrolling, because the scroll operation continues to consume computing resources until the timeout.
See Also: OpenSearch - Scroll
Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Attributes Description
scroll_id string <optional>
The ID of the scroll to be terminated. Use `_all` to close all open scroll contexts.
options Object <optional>
Options for Transport#request
callback function <optional>
Callback that handles errors and response
Source:
Returns:
Type
Object | Promise.<never> | *

(static) explainApi(params, optionsopt, callbackopt) → {Object|Promise.<never>|*}

Returns information about why a specific matches (or doesn't match) a query.
See also: OpenSearch - Explain
Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Attributes Default Description
id string <optional>
The document ID
index string <optional>
The name of the index
body Object <optional>
The query definition using the Query DSL
analyzer string <optional>
The analyzer to use for the query string
analyze_wildcard boolean <optional>
false Specify whether wildcard and prefix queries should be analyzed
default_operator string <optional>
OR The default operator for query string query (options: AND, OR)
df string <optional>
The default field for query string query (default: _all)
stored_fields string <optional>
A comma-separated list of stored fields to return in the response
lenient boolean <optional>
Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
preference string <optional>
Specify the node or shard the operation should be performed on (default: random)
q string <optional>
Query in the Lucene query string syntax
routing string <optional>
Specific routing value
_source string <optional>
true Whether to include the '_source' field in the response body.
_source_excludes string <optional>
A comma-separated list of source fields to exclude in the query response.
_source_includes string <optional>
A comma-separated list of source fields to include in the query response.
options Object <optional>
Options for Transport#request
callback function <optional>
Callback that handles errors and response
Source:
Returns:
Type
Object | Promise.<never> | *

(static) msearchApi(params, options, callback) → {Object|Promise.<never>|*}

Allows to execute several search operations in one request.
See Also: OpenSearch - Multi-Search
Parameters:
Name Type Description
params Object
Properties
Name Type Attributes Description
index string A comma-separated list of index names to use as default
body Object The request definitions (metadata-search request definition pairs), separated by newlines
search_type string <optional>
Search operation type (options: query_then_fetch, dfs_query_then_fetch)
max_concurrent_searches number <optional>
Controls the maximum number of concurrent searches the multi search api will execute
typed_keys boolean <optional>
Specify whether aggregation and suggester names should be prefixed by their respective types in the response
pre_filter_shard_size number <optional>
A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.
max_concurrent_shard_requests number <optional>
The number of concurrent shard requests each sub search executes concurrently per node. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests
rest_total_hits_as_int boolean <optional>
Indicates whether hits.total should be rendered as an integer or an object in the rest search response
ccs_minimize_roundtrips boolean <optional>
Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
options Object Options for Transport#request
callback function Callback that handles errors and response
Source:
Returns:
Type
Object | Promise.<never> | *

(static) msearchTemplateApi(params, options, callback) → {Object|Promise.<never>|*}

Allows to execute several search template operations in one request.
Parameters:
Name Type Description
params Object
Properties
Name Type Attributes Description
index string A comma-separated list of index names to use as default
body Object The request definitions (metadata-search request definition pairs), separated by newlines
search_type string <optional>
Search operation type (options: query_then_fetch, dfs_query_then_fetch)
typed_keys boolean <optional>
Specify whether aggregation and suggester names should be prefixed by their respective types in the response
max_concurrent_searches number <optional>
Controls the maximum number of concurrent searches the multi search api will execute
rest_total_hits_as_int boolean <optional>
Indicates whether hits.total should be rendered as an integer or an object in the rest search response
ccs_minimize_roundtrips boolean <optional>
Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
options Object Options for Transport#request
callback function Callback that handles errors and response
Source:
Returns:
Type
Object | Promise.<never> | *

(static) rankEvalApi(params, optionsopt, callbackopt) → {Object|Promise.<never>|*}

Allows to evaluate the quality of ranked search results over a set of typical search queries
See Also: OpenSearch - Ranking evaluation
Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Attributes Description
index string <optional>
A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
body Object The ranking evaluation search definition, including search requests, document ratings and ranking metric definition
ignore_unavailable boolean <optional>
Whether specified concrete indices should be ignored when unavailable (missing or closed)
allow_no_indices boolean <optional>
Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
expand_wildcards string <optional>
Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
search_type string <optional>
Search operation type (options: query_then_fetch, dfs_query_then_fetch)
options Object <optional>
Options for Transport#request
callback function <optional>
Callback that handles errors and response
Source:
Returns:
Type
Object | Promise.<never> | *

(static) renderSearchTemplateApi(params, options, callback) → {Object|Promise.<never>|*}

Allows to use the Mustache language to pre-render a search definition.
Parameters:
Name Type Description
params Object
Properties
Name Type Attributes Description
id string <optional>
The id of the stored search template
body Object <optional>
The search definition template and its params
options Object Options for Transport#request
callback function Callback that handles errors and response
Source:
Returns:
Type
Object | Promise.<never> | *

(static) scrollApi(params, optionsopt, callbackopt) → {Object|Promise.<never>|*}

Allows to retrieve a large numbers of results from a single search request.
See Also: OpenSearch - Scroll
Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Attributes Description
scroll_id string <optional>
The scroll ID *Deprecated*
scroll string <optional>
Specify how long a consistent view of the index should be maintained for scrolled search
rest_total_hits_as_int boolean <optional>
Indicates whether hits.total should be rendered as an integer or an object in the rest search response
body Object <optional>
The scroll ID if not passed by URL or query parameter.
options Object <optional>
Options for Transport#request
callback function <optional>
Callback that handles errors and response
Source:
Returns:
Type
Object | Promise.<never> | *

(static) searchApi(params, options, callback) → {Object|Promise.<never>|*}

Allows to execute several search operations in one request.
See Also: OpenSearch - Search
Parameters:
Name Type Description
params Object
Properties
Name Type Attributes Description
index string A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
analyzer string <optional>
The analyzer to use for the query string
analyze_wildcard boolean <optional>
Specify whether wildcard and prefix queries should be analyzed (default: false)
ccs_minimize_roundtrips boolean <optional>
Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
default_operator string <optional>
The default operator for query string query (AND or OR) (options: AND, OR)
df string <optional>
The field to use as default where no field prefix is given in the query string
explain boolean <optional>
Specify whether to return detailed information about score computation as part of a hit
stored_fields string <optional>
A comma-separated list of stored fields to return as part of a hit
docvalue_fields string <optional>
A comma-separated list of fields to return as the docvalue representation of a field for each hit
from number <optional>
Starting offset (default: 0)
ignore_unavailable boolean <optional>
Whether specified concrete indices should be ignored when unavailable (missing or closed)
ignore_throttled boolean <optional>
Whether specified concrete, expanded or aliased indices should be ignored when throttled
allow_no_indices boolean <optional>
Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
expand_wildcards string <optional>
Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
lenient boolean <optional>
Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
preference string <optional>
Specify the node or shard the operation should be performed on (default: random)
q string <optional>
Query in the Lucene query string syntax
routing string <optional>
A comma-separated list of specific routing values
scroll string <optional>
Specify how long a consistent view of the index should be maintained for scrolled search
search_type string <optional>
Search operation type (options: query_then_fetch, dfs_query_then_fetch)
size number <optional>
Number of hits to return (default: 10)
sort string <optional>
A comma-separated list of : pairs
_source string <optional>
True or false to return the _source field or not, or a list of fields to return
_source_excludes string <optional>
A list of fields to exclude from the returned _source field
_source_includes string <optional>
A list of fields to extract and return from the _source field
terminate_after number <optional>
The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.
stats string <optional>
Specific 'tag' of the request for logging and statistical purposes
suggest_field string <optional>
Specify which field to use for suggestions
suggest_mode string <optional>
Specify suggest mode (options: missing, popular, always)
suggest_size number <optional>
How many suggestions to return in response
suggest_text string <optional>
The source text for which the suggestions should be returned
timeout string <optional>
Explicit operation timeout
track_scores boolean <optional>
Whether to calculate and return scores even if they are not used for sorting
track_total_hits boolean <optional>
Indicate if the number of documents that match the query should be tracked
allow_partial_search_results boolean <optional>
Indicate if an error should be returned if there is a partial search failure or timeout
typed_keys boolean <optional>
Specify whether aggregation and suggester names should be prefixed by their respective types in the response
version boolean <optional>
Specify whether to return document version as part of a hit
seq_no_primary_term boolean <optional>
Specify whether to return sequence number and primary term of the last modification of each hit
request_cache boolean <optional>
Specify if request cache should be used for this request or not, defaults to index level setting
batched_reduce_size number <optional>
The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large.
max_concurrent_shard_requests number <optional>
The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests
pre_filter_shard_size number <optional>
A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.
rest_total_hits_as_int boolean <optional>
Indicates whether hits.total should be rendered as an integer or an object in the rest search response
min_compatible_shard_node string <optional>
The minimum compatible version that all shards involved in search should have for this request to be successful
body Object <optional>
The search definition using the Query DSL
options Object Options for Transport#request
callback function Callback that handles errors and response
Source:
Returns:
Type
Object | Promise.<never> | *

(static) searchShardsApi(params, options, callback) → {Object|Promise.<never>|*}

Returns information about the indices and shards that a search request would be executed against.
Parameters:
Name Type Description
params Object
Properties
Name Type Attributes Description
index string <optional>
A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
preference string <optional>
Specify the node or shard the operation should be performed on (default: random)
routing string <optional>
Specific routing value
local boolean <optional>
Return local information, do not retrieve the state from cluster_manager node (default: false)
ignore_unavailable boolean <optional>
Whether specified concrete indices should be ignored when unavailable (missing or closed)
allow_no_indices boolean <optional>
Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
expand_wildcards string <optional>
Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
options Object Options for Transport#request
callback function Callback that handles errors and response
Source:
Returns:
Type
Object | Promise.<never> | *

(static) searchTemplateApi(params, options, callback) → {Object|Promise.<never>|*}

Allows to use the Mustache language to pre-render a search definition.
Parameters:
Name Type Description
params Object
Properties
Name Type Attributes Description
index string A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
body Object The search definition template and its params
ignore_unavailable boolean <optional>
Whether specified concrete indices should be ignored when unavailable (missing or closed)
ignore_throttled boolean <optional>
Whether specified concrete, expanded or aliased indices should be ignored when throttled
allow_no_indices boolean <optional>
Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
expand_wildcards string <optional>
Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
preference string <optional>
Specify the node or shard the operation should be performed on (default: random)
routing string <optional>
A comma-separated list of specific routing values
scroll string <optional>
Specify how long a consistent view of the index should be maintained for scrolled search
search_type string <optional>
Search operation type (options: query_then_fetch, dfs_query_then_fetch)
explain boolean <optional>
Specify whether to return detailed information about score computation as part of a hit
profile boolean <optional>
Specify whether to profile the query execution
typed_keys boolean <optional>
Specify whether aggregation and suggester names should be prefixed by their respective types in the response
rest_total_hits_as_int boolean <optional>
Indicates whether hits.total should be rendered as an integer or an object in the rest search response
ccs_minimize_roundtrips boolean <optional>
Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
options Object Options for Transport#request
callback function Callback that handles errors and response
Source:
Returns:
Type
Object | Promise.<never> | *