ElasticsearchClient.ElasticTransport.Client
— TypeElasticSearch client. Handling hosts configuration, verify elasticsearch and delegate requests to Transport
function Client(;http_client::Module, kwargs...)
Create a client connected to an Elastic cluster.
Possible arguments
http_client::Module
: A module that implement request method. Maybe useful if you need custom http layers. HTTP.jl used bu default.hosts
: Single host passed as a String, Dict or NamedTuple, or multiple hosts passed as an Array;host
,url
,urls
keys are also validserializer
: Function to serialise the body to JSON. JSON.json by defaultdeserializer
: Function to deserialise response body to Dict. JSON.parse by defaultresurrect_after::Integer
: After how many seconds a dead connection should be tried againreload_connection::Bool
: Reload connections after X requests (false by default)randomize_hosts::Bool
: Shuffle connections on initialization and reload (false by default)sniffer_timeout::Integer
: Timeout for reloading connections in seconds (1 by default)retry_on_failure::Bool
: Retry X times when request fails before raising and exception (false by default)delay_on_retry::Integer
: Delay in milliseconds between each retry (0 by default)retry_on_status::Vector{Integer}
: Retry when specific status codes are returnedreload_on_failure::Bool
: Reload connections after failure (false by default)request_timeout::Integer
: The request timeout to be passed to transport in optionstransport_options
: Options to be passed to Connection. Now work onlyheaders
optionselector::Connections.AbstractSelector
A struct type of selector strategy.send_get_body_as
: Specify the HTTP method to use for GET requests with a body. (Default: GET)compression
Whether to compress requests. Gzip compression will be used. The default is false. Responses will automatically be inflated if they are compressed.
ElasticsearchClient.ElasticTransport.perform_request
— MethodLow-level request to Elastic cluster.
Arguments
client::ElasticTransport.Client
method::String
path::String
: elastic endpoint. Must start with /
Keyword arguments
params::Dict
: Query paramsbody::Union{Nothing, Dict}
: HTTP body, default Nothingheaders::Union{Nothing, Dict}
: HTTP headers. They are merged with default headers. Default Nothing
ElasticsearchClient.API.Indices.create
— MethodCreates an index with optional settings and mappings.
index::String
: The name of the indexwait_for_active_shards::String
: Set the number of active shards to wait for before the operation returns.timeout::DateTime
: Explicit operation timeoutmaster_timeout::DateTime
: Specify timeout for connection to masterheaders::Dict
: Custom HTTP headersbody::Union{NamedTuple,Dict}
: The configuration for the index (settings
andmappings
)
See https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html
ElasticsearchClient.API.Indices.delete
— MethodDeletes an index.
index::Union{String,Vector{String}}
: A comma-separated list of indices to delete; use_all
or*
string to delete all indicestimeout::DateTime
: Explicit operation timeoutmaster_timeout::DateTime
: Specify timeout for connection to masterignore_unavailable::Bool
: Ignore unavailable indexes (default: false)allow_no_indices::Bool
: Ignore if a wildcard expression resolves to no concrete indices (default: false)expand_wildcards::String
: Whether wildcard expressions should get expanded to open, closed, or hidden indices (options: open, closed, hidden, none, all)headers::Dict
: Custom HTTP headers
See https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-index.html
ElasticsearchClient.API.Indices.exists
— MethodReturns information about whether a particular index exists.
index::Union{String,Vector{String}}
: A comma-separated list of index nameslocal::Bool
: Return local information, do not retrieve the state from master node (default: false)ignore_unavailable::Bool
: Ignore unavailable indexes (default: false)allow_no_indices::Bool
: Ignore if a wildcard expression resolves to no concrete indices (default: false)expand_wildcards::String
: Whether wildcard expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all)flat_settings::Bool
: Return settings in flat format (default: false)include_defaults::Bool
: Whether to return all default setting for each of the indices.headers::Dict
: Custom HTTP headers
See https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-exists.html
ElasticsearchClient.API.Indices.exists_alias
— MethodReturns information about whether a particular alias exists.
name::Union{String,Vector{String}}
: A comma-separated list of alias names to returnindex::Union{String,Vector{String}}
: A comma-separated list of index names to filter aliasesignore_unavailable::Bool
: Whether specified concrete indices should be ignored when unavailable (missing or closed)allow_no_indices::Bool
: 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
: Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)local::Bool
: Return local information, do not retrieve the state from master node (default: false)headers::Dict
: Custom HTTP headers
See https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html
ElasticsearchClient.API.Indices.get
— MethodReturns information about one or more indices.
index::Union(String,Vector{String}}
: A comma-separated list of index nameslocal::Bool
: Return local information, do not retrieve the state from master node (default: false)ignore_unavailable::Bool
: Ignore unavailable indexes (default: false)allow_no_indices::Bool
: Ignore if a wildcard expression resolves to no concrete indices (default: false)expand_wildcards::String
: Whether wildcard expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all)features::String
: Return only information on specified index features (options: aliases, mappings, settings)flat_settings::Bool
: Return settings in flat format (default: false)include_defaults::Bool
: Whether to return all default setting for each of the indices.master_timeout::DateTime
: Specify timeout for connection to masterheaders::Dict
: Custom HTTP headers
See https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-index.html
ElasticsearchClient.API.Indices.put_alias
— MethodCreates or updates an alias.
index::Union{String,Vector{String}}
: A comma-separated list of index names the alias should point to (supports wildcards); use_all
to perform the operation on all indices.name::String
: The name of the alias to be created or updatedtimeout::DateTime
: Explicit timestamp for the documentmaster_timeout::DateTime
: Specify timeout for connection to masterheaders::Dict
: Custom HTTP headersbody::Union{NamedTuple,Dict}
: The settings for the alias, such asrouting
orfilter
See https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html
ElasticsearchClient.API.Indices.refresh
— MethodPerforms the refresh operation in one or more indices.
index::Union{String,Vector{String}}
: A comma-separated list of index names; use_all
or empty string to perform the operation on all indicesignore_unavailable::Bool
: Whether specified concrete indices should be ignored when unavailable (missing or closed)allow_no_indices::Bool
: 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
: Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)headers::Dict
: Custom HTTP headers
See https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-refresh.html
ElasticsearchClient.API.Indices.update_aliases
— MethodUpdates index aliases.
timeout::DateTime
: Request timeoutmaster_timeout::DateTime
: Specify timeout for connection to masterheaders::Dict
: Custom HTTP headersbody::Union{NamedTuple,Dict}
: The definition ofactions
to perform (Required)
See https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html
ElasticsearchClient.API.Cat.indices
— MethodReturns information about indices: number of primaries and replicas, document counts, disk size, ...
index::Union{String,Vector{String}}
: A comma-separated list of index names to limit the returned informationformat::String
: a short version of the Accept header, e.g. json, yamlbytes::String
: The unit in which to display byte values (options: b, k, kb, m, mb, g, gb, t, tb, p, pb)master_timeout::DateTime
: Explicit operation timeout for connection to master nodeh::Union{String,Vector{String}}
: Comma-separated list of column names to displayhealth::String
: A health status ("green", "yellow", or "red" to filter only indices matching the specified health status (options: green, yellow, red)help::Bool
: Return help informationpri::Bool
: Set to true to return stats only for primary shardss::Union{String,Vector{String}}
: Comma-separated list of column names or column aliases to sort bytime::String
: The unit in which to display time values (options: d, h, m, s, ms, micros, nanos)v::Bool
: Verbose mode. Display column headersinclude_unloaded_segments::Bool
: If set to true segment stats will include stats for segments that are not currently loaded into memoryexpand_wildcards::String
: Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)headers::Dict
: Custom HTTP headers
See https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-indices.html
ElasticsearchClient.API.Response
— TypeStore Elastic response with body, headers and status
function Response(http_response::HTTP.Response)
Create response structure and convert body to String if it's CodeUnits
ElasticsearchClient.API.bulk
— MethodAllows to perform multiple index/update/delete operations in a single request.
index::String
: Default index for items which don't provide onewait_for_active_shards::String
: Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set toall
for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)refresh::String
: Iftrue
then refresh the affected shards to make this operation visible to search, ifwait_for
then wait for a refresh to make this operation visible to search, iffalse
(the default) then do nothing with refreshes. (options: true, false, wait_for)routing::String
: Specific routing valuetimeout::DateTime
: Explicit operation timeouttype::String
: Default document type for items which don't provide one_source::Union{Vector{String}, String}
: True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request_source_excludes::Union{Vector{String}, String}
: Default list of fields to exclude from the returned _source field, can be overridden on each sub-request_source_includes::Union{Vector{String}, String}
: Default list of fields to extract and return from the _source field, can be overridden on each sub-requestpipeline::String
: The pipeline id to preprocess incoming documents withrequire_alias::Bool
: Sets require_alias for all incoming documents. Defaults to unset (false)headers::Bool
: Custom HTTP headersbody::Union{String,Vector}
: The operation definition and data (action-data pairs), separated by newlines. Array of String or Dicts or NamedTuples
See https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html
ElasticsearchClient.API.delete
— MethodRemoves a document from the index.
id::String
: The document IDindex::String
: The name of the indexwait_for_active_shards::String
: Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set toall
for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)refresh::String
: Iftrue
then refresh the affected shards to make this operation visible to search, ifwait_for
then wait for a refresh to make this operation visible to search, iffalse
(the default) then do nothing with refreshes. (options: true, false, wait_for)routing::String
: Specific routing valuetimeout::DateTime
: Explicit operation timeoutif_seq_no::Integer
: only perform the delete operation if the last operation that has changed the document has the specified sequence numberif_primary_term::Integer
: only perform the delete operation if the last operation that has changed the document has the specified primary termversion::Integer
: Explicit version number for concurrency controlversion_type::String
: Specific version type (options: internal, external, external_gte)headers::Dict
: Custom HTTP headers
See https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete.html
ElasticsearchClient.API.delete_by_query
— MethodDeletes documents matching the provided query.
index::Union{String, Vector{String}}
: A comma-separated list of index names to search; use_all
or empty string to perform the operation on all indicesanalyzer::String
: The analyzer to use for the query stringanalyze_wildcard::Bool
: Specify whether wildcard and prefix queries should be analyzed (default: false)default_operator::String
: The default operator for query string query (AND or OR) (options: AND, OR)df::String
: The field to use as default where no field prefix is given in the query stringfrom::Integer
: Starting offset (default: 0)ignore_unavailable::Bool
: Whether specified concrete indices should be ignored when unavailable (missing or closed)allow_no_indices::Bool
: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes_all
string or when no indices have been specified)conflicts::String
: What to do when the delete by query hits version conflicts? (options: abort, proceed)expand_wildcards::String
: Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)lenient::Bool
: Specify whether format-based query failures (such as providing text to a numeric field) should be ignoredpreference::String
: Specify the node or shard the operation should be performed on (default: random)q::String
: Query in the Lucene query string syntaxrouting::Union{String, Vector{String}}
: A comma-separated list of specific routing valuesscroll::DateTime
: Specify how long a consistent view of the index should be maintained for scrolled searchsearch_type::String
: Search operation type (options: querythenfetch, dfsquerythen_fetch)search_timeout::DateTime
: Explicit timeout for each search request. Defaults to no timeout.max_docs::Integer
: Maximum number of documents to process (default: all documents)sort::Union{String, Vector{String}}
: A comma-separated list of <field>:<direction> pairsterminate_after::Integer
: The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.stats::Union{String, Vector{String}}
: Specific 'tag' of the request for logging and statistical purposesversion::Bool
: Specify whether to return document version as part of a hitrequest_cache::Bool
: Specify if request cache should be used for this request or not, defaults to index level settingrefresh::Bool
: Should the affected indexes be refreshed?timeout::DateTime
: Time each individual bulk request should wait for shards that are unavailable.wait_for_active_shards::String
: Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set toall
for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)scroll_size::Integer
: Size on the scroll request powering the delete by querywait_for_completion::Bool
: Should the request should block until the delete by query is complete.requests_per_second::Integer
: The throttle for this request in sub-requests per second. -1 means no throttle.slices::Union{Dict,String}
: The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set toauto
.headers::Dict
: Custom HTTP headersbody::Dict
: The search definition using the Query DSL (Required)
See https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html
ElasticsearchClient.API.index
— MethodCreates or updates a document in an index.
id::String
: Document IDindex::String
: The name of the indexwait_for_active_shards::String
: Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set toall
for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)op_type::String
: Explicit operation type. Defaults toindex
for requests with an explicit document ID, and tocreate
for requests without an explicit document ID (options: index, create)refresh::String
: Iftrue
then refresh the affected shards to make this operation visible to search, ifwait_for
then wait for a refresh to make this operation visible to search, iffalse
(the default) then do nothing with refreshes. (options: true, false, wait_for)routing::String
: Specific routing valuetimeout::DateTime
: Explicit operation timeoutversion::Integer
: Explicit version number for concurrency controlversion_type::String
: Specific version type (options: internal, external, external_gte)if_seq_no::Integer
: only perform the index operation if the last operation that has changed the document has the specified sequence numberif_primary_term::Integer
: only perform the index operation if the last operation that has changed the document has the specified primary termpipeline::String
: The pipeline id to preprocess incoming documents withrequire_alias::Bool
: When true, requires destination to be an alias. Default is falseheaders::Dict
: Custom HTTP headersbody::Union{NamedTuple,Dict}
: The document (Required)
See https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html
ElasticsearchClient.API.put_script
— MethodCreates or updates a script.
id::String
: Script IDcontext::String
: Script contexttimeout::DateTime
: Explicit operation timeoutmaster_timeout::DateTime
: Specify timeout for connection to masterheaders::Dict
: Custom HTTP headersbody::Union{Dict,NamedTuple}
: The document (Required)
See https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html
ElasticsearchClient.API.search
— MethodReturns results matching a query.
index::Union{String, Vector{String}}
: A comma-separated list of index names to search; use_all
or empty string to perform the operation on all indicesanalyzer::String
: The analyzer to use for the query stringanalyze_wildcard::Bool
: specify whether wildcard and prefix queries should be analyzed (default: false)ccs_minimize_roundtrips::Bool
: Indicates whether network round-trips should be minimized as part of cross-cluster search requests executiondefault_operator::String
: The default operator for query string query (AND or OR) (options: AND, OR)df::String
: The field to use as default where no field prefix is given in the query stringexplain::Bool
: Specify whether to return detailed information about score computation as part of a hitstored_fields::{String, Vector{String}}
: A comma-separated list of stored fields to return as part of a hitdocvalue_fields::{String, Vector{String}}
A comma-separated list of fields to return as the docvalue representation of a field for each hitfrom::Integer
: Starting offset (default: 0)force_synthetic_source::Bool
: Should this request force synthetic _source? Use this to test if the mapping supports synthetic _source and to get a sense of the worst case performance. Fetches with this enabled will be slower the enabling synthetic source natively in the index.ignore_unavailable::Bool
: Whether specified concrete indices should be ignored when unavailable (missing or closed)ignore_throttled::Bool
: Whether specified concrete, expanded or aliased indices should be ignored when throttledallow_no_indices::Bool
: 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
: Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)lenient::Bool
: Specify whether format-based query failures (such as providing text to a numeric field) should be ignoredpreference::String
: Specify the node or shard the operation should be performed on (default: random)q::String
: Query in the Lucene query string syntaxrouting::Union{String, Vector{String}}
: A comma-separated list of specific routing valuesscroll::DateTime
: Specify how long a consistent view of the index should be maintained for scrolled searchsearch_type::String
: Search operation type (options: querythenfetch, dfsquerythen_fetch)size::Integer
: Number of hits to return (default: 10)sort::Union{String, Vector{String}}
: A comma-separated list of <field>:<direction> pairs_source::Union{String, Vector{String}}
: True or false to return the _source field or not, or a list of fields to return_source_excludes::Union{String, Vector{String}}
: A list of fields to exclude from the returned _source field_source_includes::Union{String, Vector{String}}
: A list of fields to extract and return from the _source fieldterminate_after::Integer
: The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.stats::Union{String, Vector{String}}
: Specific 'tag' of the request for logging and statistical purposessuggest_field::String
: Specify which field to use for suggestionssuggest_mode::String
: Specify suggest mode (options: missing, popular, always)suggest_size::Integer
: How many suggestions to return in responsesuggest_text::String
: The source text for which the suggestions should be returnedtimeout::DateTime
: Explicit operation timeouttrack_scores::Bool
: Whether to calculate and return scores even if they are not used for sorting- `[Boolean|long] :tracktotalhits Indicate if the number of documents that match the query should be tracked. A number can also be specified, to accurately track the total hit count up to the number.
allow_partial_search_results::Bool
: Indicate if an error should be returned if there is a partial search failure or timeouttyped_keys::Bool
: Specify whether aggregation and suggester names should be prefixed by their respective types in the responseversion::Bool
: Specify whether to return document version as part of a hitseq_no_primary_term::Bool
: Specify whether to return sequence number and primary term of the last modification of each hitrequest_cache::Bool
: Specify if request cache should be used for this request or not, defaults to index level settingbatched_reduce_size::Integer
: 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::Integer
: 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 requestspre_filter_shard_size::Integer
: 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::Bool
: Indicates whether hits.total should be rendered as an integer or an object in the rest search responsemin_compatible_shard_node::String
: The minimum compatible version that all shards involved in search should have for this request to be successfulheaders::Dict
: Custom HTTP headersbody::Union{Dict,NamedTuple}
: The search definition using the Query DSL
See https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html
ElasticsearchClient.API.search_template
— MethodAllows to use the Mustache language to pre-render a search definition.
index::Union{String,Vector{String}}
: A comma-separated list of index names to search; use_all
or empty string to perform the operation on all indicesignore_unavailable::Bool
: Whether specified concrete indices should be ignored when unavailable (missing or closed)ignore_throttled::Bool
: Whether specified concrete, expanded or aliased indices should be ignored when throttledallow_no_indices::Bool
: 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
: Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)preference::String
: Specify the node or shard the operation should be performed on (default: random)routing::Union{String,Vector{String}}
: A comma-separated list of specific routing valuesscroll::DateTime
: Specify how long a consistent view of the index should be maintained for scrolled searchsearch_type::String
: Search operation type (options: querythenfetch, dfsquerythen_fetch)explain::Bool
: Specify whether to return detailed information about score computation as part of a hitprofile::Bool
: Specify whether to profile the query executiontyped_keys::Bool
: Specify whether aggregation and suggester names should be prefixed by their respective types in the responserest_total_hits_as_int::Bool
: Indicates whether hits.total should be rendered as an integer or an object in the rest search responseccs_minimize_roundtrips::Bool
: Indicates whether network round-trips should be minimized as part of cross-cluster search requests executionheaders::Dict
: Custom HTTP headersbody::Union{Dict,NamedTuple}
: The search definition template and its params (Required)
See https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html