- Elasticsearch Guide: other versions:
- What is Elasticsearch?
- What’s new in 7.10
- Getting started with Elasticsearch
- Set up Elasticsearch
- Installing Elasticsearch
- Configuring Elasticsearch
- Setting JVM options
- Secure settings
- Auditing settings
- Circuit breaker settings
- Cluster-level shard allocation and routing settings
- Cross-cluster replication settings
- Discovery and cluster formation settings
- Field data cache settings
- HTTP
- Index lifecycle management settings
- Index management settings
- Index recovery settings
- Indexing buffer settings
- License settings
- Local gateway settings
- Logging
- Machine learning settings
- Monitoring settings
- Node
- Network settings
- Node query cache settings
- Search settings
- Security settings
- Shard request cache settings
- Snapshot lifecycle management settings
- Transforms settings
- Transport
- Thread pools
- Watcher settings
- Important Elasticsearch configuration
- Important System Configuration
- Bootstrap Checks
- Heap size check
- File descriptor check
- Memory lock check
- Maximum number of threads check
- Max file size check
- Maximum size virtual memory check
- Maximum map count check
- Client JVM check
- Use serial collector check
- System call filter check
- OnError and OnOutOfMemoryError checks
- Early-access check
- G1GC check
- All permission check
- Discovery configuration check
- Bootstrap Checks for X-Pack
- Starting Elasticsearch
- Stopping Elasticsearch
- Discovery and cluster formation
- Add and remove nodes in your cluster
- Full-cluster restart and rolling restart
- Remote clusters
- Set up X-Pack
- Configuring X-Pack Java Clients
- Plugins
- Upgrade Elasticsearch
- Index modules
- Mapping
- Text analysis
- Overview
- Concepts
- Configure text analysis
- Built-in analyzer reference
- Tokenizer reference
- Token filter reference
- Apostrophe
- ASCII folding
- CJK bigram
- CJK width
- Classic
- Common grams
- Conditional
- Decimal digit
- Delimited payload
- Dictionary decompounder
- Edge n-gram
- Elision
- Fingerprint
- Flatten graph
- Hunspell
- Hyphenation decompounder
- Keep types
- Keep words
- Keyword marker
- Keyword repeat
- KStem
- Length
- Limit token count
- Lowercase
- MinHash
- Multiplexer
- N-gram
- Normalization
- Pattern capture
- Pattern replace
- Phonetic
- Porter stem
- Predicate script
- Remove duplicates
- Reverse
- Shingle
- Snowball
- Stemmer
- Stemmer override
- Stop
- Synonym
- Synonym graph
- Trim
- Truncate
- Unique
- Uppercase
- Word delimiter
- Word delimiter graph
- Character filters reference
- Normalizers
- Index templates
- Data streams
- Ingest node
- Search your data
- Query DSL
- Aggregations
- Bucket aggregations
- Adjacency matrix
- Auto-interval date histogram
- Children
- Composite
- Date histogram
- Date range
- Diversified sampler
- Filter
- Filters
- Geo-distance
- Geohash grid
- Geotile grid
- Global
- Histogram
- IP range
- Missing
- Nested
- Parent
- Range
- Rare terms
- Reverse nested
- Sampler
- Significant terms
- Significant text
- Terms
- Variable width histogram
- Subtleties of bucketing range fields
- Metrics aggregations
- Pipeline aggregations
- Bucket aggregations
- EQL
- SQL access
- Overview
- Getting Started with SQL
- Conventions and Terminology
- Security
- SQL REST API
- SQL Translate API
- SQL CLI
- SQL JDBC
- SQL ODBC
- SQL Client Applications
- SQL Language
- Functions and Operators
- Comparison Operators
- Logical Operators
- Math Operators
- Cast Operators
- LIKE and RLIKE Operators
- Aggregate Functions
- Grouping Functions
- Date/Time and Interval Functions and Operators
- Full-Text Search Functions
- Mathematical Functions
- String Functions
- Type Conversion Functions
- Geo Functions
- Conditional Functions And Expressions
- System Functions
- Reserved keywords
- SQL Limitations
- Scripting
- Data management
- ILM: Manage the index lifecycle
- Overview
- Concepts
- Automate rollover
- Manage Filebeat time-based indices
- Index lifecycle actions
- Configure a lifecycle policy
- Migrate index allocation filters to node roles
- Resolve lifecycle policy execution errors
- Start and stop index lifecycle management
- Manage existing indices
- Skip rollover
- Restore a managed data stream or index
- Monitor a cluster
- Frozen indices
- Roll up or transform your data
- Set up a cluster for high availability
- Snapshot and restore
- Secure a cluster
- Overview
- Configuring security
- User authentication
- Built-in users
- Internal users
- Token-based authentication services
- Realms
- Realm chains
- Active Directory user authentication
- File-based user authentication
- LDAP user authentication
- Native user authentication
- OpenID Connect authentication
- PKI user authentication
- SAML authentication
- Kerberos authentication
- Integrating with other authentication systems
- Enabling anonymous access
- Controlling the user cache
- Configuring SAML single-sign-on on the Elastic Stack
- Configuring single sign-on to the Elastic Stack using OpenID Connect
- User authorization
- Built-in roles
- Defining roles
- Granting access to Stack Management features
- Security privileges
- Document level security
- Field level security
- Granting privileges for data streams and index aliases
- Mapping users and groups to roles
- Setting up field and document level security
- Submitting requests on behalf of other users
- Configuring authorization delegation
- Customizing roles and authorization
- Enabling audit logging
- Encrypting communications
- Restricting connections with IP filtering
- Cross cluster search, clients, and integrations
- Tutorial: Getting started with security
- Tutorial: Encrypting communications
- Troubleshooting
- Some settings are not returned via the nodes settings API
- Authorization exceptions
- Users command fails due to extra arguments
- Users are frequently locked out of Active Directory
- Certificate verification fails for curl on Mac
- SSLHandshakeException causes connections to fail
- Common SSL/TLS exceptions
- Common Kerberos exceptions
- Common SAML issues
- Internal Server Error in Kibana
- Setup-passwords command fails due to connection failure
- Failures due to relocation of the configuration files
- Limitations
- Watch for cluster and index events
- Command line tools
- How To
- Glossary of terms
- REST APIs
- API conventions
- Compact and aligned text (CAT) APIs
- cat aliases
- cat allocation
- cat anomaly detectors
- cat count
- cat data frame analytics
- cat datafeeds
- cat fielddata
- cat health
- cat indices
- cat master
- cat nodeattrs
- cat nodes
- cat pending tasks
- cat plugins
- cat recovery
- cat repositories
- cat segments
- cat shards
- cat snapshots
- cat task management
- cat templates
- cat thread pool
- cat trained model
- cat transforms
- Cluster APIs
- Cluster allocation explain
- Cluster get settings
- Cluster health
- Cluster reroute
- Cluster state
- Cluster stats
- Cluster update settings
- Nodes feature usage
- Nodes hot threads
- Nodes info
- Nodes reload secure settings
- Nodes stats
- Pending cluster tasks
- Remote cluster info
- Task management
- Voting configuration exclusions
- Cross-cluster replication APIs
- Data stream APIs
- Document APIs
- Enrich APIs
- Graph explore API
- Index APIs
- Add index alias
- Analyze
- Clear cache
- Clone index
- Close index
- Create index
- Delete index
- Delete index alias
- Delete component template
- Delete index template
- Delete index template (legacy)
- Flush
- Force merge
- Freeze index
- Get component template
- Get field mapping
- Get index
- Get index alias
- Get index settings
- Get index template
- Get index template (legacy)
- Get mapping
- Index alias exists
- Index exists
- Index recovery
- Index segments
- Index shard stores
- Index stats
- Index template exists (legacy)
- Open index
- Put index template
- Put index template (legacy)
- Put component template
- Put mapping
- Refresh
- Rollover index
- Shrink index
- Simulate index
- Simulate template
- Split index
- Synced flush
- Type exists
- Unfreeze index
- Update index alias
- Update index settings
- Resolve index
- List dangling indices
- Import dangling index
- Delete dangling index
- Index lifecycle management APIs
- Ingest APIs
- Info API
- Licensing APIs
- Machine learning anomaly detection APIs
- Add events to calendar
- Add jobs to calendar
- Close jobs
- Create jobs
- Create calendars
- Create datafeeds
- Create filters
- Delete calendars
- Delete datafeeds
- Delete events from calendar
- Delete filters
- Delete forecasts
- Delete jobs
- Delete jobs from calendar
- Delete model snapshots
- Delete expired data
- Estimate model memory
- Find file structure
- Flush jobs
- Forecast jobs
- Get buckets
- Get calendars
- Get categories
- Get datafeeds
- Get datafeed statistics
- Get influencers
- Get jobs
- Get job statistics
- Get machine learning info
- Get model snapshots
- Get overall buckets
- Get scheduled events
- Get filters
- Get records
- Open jobs
- Post data to jobs
- Preview datafeeds
- Revert model snapshots
- Set upgrade mode
- Start datafeeds
- Stop datafeeds
- Update datafeeds
- Update filters
- Update jobs
- Update model snapshots
- Machine learning data frame analytics APIs
- Create data frame analytics jobs
- Create trained models
- Update data frame analytics jobs
- Delete data frame analytics jobs
- Delete trained models
- Evaluate data frame analytics
- Explain data frame analytics
- Get data frame analytics jobs
- Get data frame analytics jobs stats
- Get trained models
- Get trained models stats
- Start data frame analytics jobs
- Stop data frame analytics jobs
- Migration APIs
- Reload search analyzers API
- Repositories metering APIs
- Rollup APIs
- Search APIs
- Searchable snapshots APIs
- Security APIs
- Authenticate
- Change passwords
- Clear cache
- Clear roles cache
- Clear privileges cache
- Clear API key cache
- Create API keys
- Create or update application privileges
- Create or update role mappings
- Create or update roles
- Create or update users
- Delegate PKI authentication
- Delete application privileges
- Delete role mappings
- Delete roles
- Delete users
- Disable users
- Enable users
- Get API key information
- Get application privileges
- Get builtin privileges
- Get role mappings
- Get roles
- Get token
- Get users
- Grant API keys
- Has privileges
- Invalidate API key
- Invalidate token
- OpenID Connect prepare authentication
- OpenID Connect authenticate
- OpenID Connect logout
- SAML prepare authentication
- SAML authenticate
- SAML logout
- SAML invalidate
- SSL certificate
- Snapshot and restore APIs
- Snapshot lifecycle management APIs
- Transform APIs
- Usage API
- Watcher APIs
- Definitions
- Migration guide
- Release notes
- Elasticsearch version 7.10.2
- Elasticsearch version 7.10.1
- Elasticsearch version 7.10.0
- Elasticsearch version 7.9.3
- Elasticsearch version 7.9.2
- Elasticsearch version 7.9.1
- Elasticsearch version 7.9.0
- Elasticsearch version 7.8.1
- Elasticsearch version 7.8.0
- Elasticsearch version 7.7.1
- Elasticsearch version 7.7.0
- Elasticsearch version 7.6.2
- Elasticsearch version 7.6.1
- Elasticsearch version 7.6.0
- Elasticsearch version 7.5.2
- Elasticsearch version 7.5.1
- Elasticsearch version 7.5.0
- Elasticsearch version 7.4.2
- Elasticsearch version 7.4.1
- Elasticsearch version 7.4.0
- Elasticsearch version 7.3.2
- Elasticsearch version 7.3.1
- Elasticsearch version 7.3.0
- Elasticsearch version 7.2.1
- Elasticsearch version 7.2.0
- Elasticsearch version 7.1.1
- Elasticsearch version 7.1.0
- Elasticsearch version 7.0.0
- Elasticsearch version 7.0.0-rc2
- Elasticsearch version 7.0.0-rc1
- Elasticsearch version 7.0.0-beta1
- Elasticsearch version 7.0.0-alpha2
- Elasticsearch version 7.0.0-alpha1
- Dependencies and versions
Glossary of terms
editGlossary of terms
edit- analysis
-
Analysis is the process of converting full text to terms. Depending on which analyzer is used, these phrases:
FOO BAR
,Foo-Bar
,foo,bar
will probably all result in the termsfoo
andbar
. These terms are what is actually stored in the index.A full text query (not a term query) for
FoO:bAR
will also be analyzed to the termsfoo
,bar
and will thus match the terms stored in the index.It is this process of analysis (both at index time and at search time) that allows Elasticsearch to perform full text queries.
- API key
- A unique identifier that you can use for authentication when submitting Elasticsearch requests. When TLS is enabled, all requests must be authenticated using either basic authentication (user name and password) or an API key.
- auto-follow pattern
- An index pattern that automatically configures new indices as follower indices for cross-cluster replication. For more information, see Managing auto follow patterns.
- cluster
- One or more nodes that share the same cluster name. Each cluster has a single master node, which is chosen automatically by the cluster and can be replaced if it fails.
- cold phase
- The third possible phase in the index lifecycle. In the cold phase, an index is no longer updated and seldom queried. The information still needs to be searchable, but it’s okay if those queries are slower.
- cold tier
- A data tier that contains nodes that hold time series data that is accessed occasionally and not normally updated.
- component template
- A building block for constructing index templates that specifies index mappings, settings, and aliases.
- content tier
- A data tier that contains nodes that handle the indexing and query load for content such as a product catalog.
- cross-cluster replication (CCR)
- A feature that enables you to replicate indices in remote clusters to your local cluster. For more information, see Cross-cluster replication.
- cross-cluster search (CCS)
- The cross-cluster search feature enables any node to act as a federated client across multiple clusters. See Search across clusters.
- data stream
-
A named resource used to ingest, search, and manage time series data in Elasticsearch. A data stream’s data is stored across multiple hidden, auto-generated indices. You can automate management of these indices to more efficiently store large data volumes.
See Data streams.
- data tier
- A collection of nodes with the same data role that typically share the same hardware profile. See content tier, hot tier, warm tier, cold tier.
- delete phase
- The last possible phase in the index lifecycle. In the delete phase, an index is no longer needed and can safely be deleted.
- document
-
A document is a JSON document which is stored in Elasticsearch. It is like a row in a table in a relational database. Each document is stored in an index and has a type and an id.
A document is a JSON object (also known in other languages as a hash / hashmap / associative array) which contains zero or more fields, or key-value pairs.
The original JSON document that is indexed will be stored in the
_source
field, which is returned by default when getting or searching for a document. - field
-
A document contains a list of fields, or key-value pairs. The value can be a simple (scalar) value (eg a string, integer, date), or a nested structure like an array or an object. A field is similar to a column in a table in a relational database.
The mapping for each field has a field type (not to be confused with document type) which indicates the type of data that can be stored in that field, eg
integer
,string
,object
. The mapping also allows you to define (amongst other things) how the value for a field should be analyzed. - filter
- A filter is a non-scoring query, meaning that it does not score documents. It is only concerned about answering the question - "Does this document match?". The answer is always a simple, binary yes or no. This kind of query is said to be made in a filter context, hence it is called a filter. Filters are simple checks for set inclusion or exclusion. In most cases, the goal of filtering is to reduce the number of documents that have to be examined.
- flush
- Peform a Lucene commit to write index updates in the transaction log (translog) to disk. Because a Lucene commit is a relatively expensive operation, Elasticsearch records index and delete operations in the translog and automatically flushes changes to disk in batches. To recover from a crash, operations that have been acknowledged but not yet committed can be replayed from the translog. Before upgrading, you can explicitly call the Flush API to ensure that all changes are committed to disk.
- follower index
- The target index for cross-cluster replication. A follower index exists in a local cluster and replicates a leader index.
- force merge
- Manually trigger a merge to reduce the number of segments in each shard of an index and free up the space used by deleted documents. You should not force merge indices that are actively being written to. Merging is normally performed automatically, but you can use force merge after rollover to reduce the shards in the old index to a single segment. See the force merge API.
- freeze
- Make an index read-only and minimize its memory footprint. Frozen indices can be searched without incurring the overhead of of re-opening a closed index, but searches are throttled and might be slower. You can freeze indices to reduce the overhead of keeping older indices searchable before you are ready to archive or delete them. See the freeze API.
- frozen index
- An index reduced to a low overhead state that still enables occasional searches. Frozen indices use a memory-efficient shard implementation and throttle searches to conserve resources. Searching a frozen index is lower overhead than re-opening a closed index to enable searching.
- hidden index
-
An index that is excluded by default when you access indices using a wildcard expression.
You can specify the
expand_wildcards
parameter to include hidden indices. Note that hidden indices are included if the wildcard expression starts with a dot, for example.watcher-history*
. - hot phase
- The first possible phase in the index lifecycle. In the hot phase, an index is actively updated and queried.
- hot tier
- A data tier that contains nodes that handle the indexing load for time series data such as logs or metrics and hold your most recent, most-frequently-accessed data.
- id
-
The ID of a document identifies a document. The
index/id
of a document must be unique. If no ID is provided, then it will be auto-generated. (also see routing) - index
-
An optimized collection of JSON documents. Each document is a collection of fields, the key-value pairs that contain your data.
An index is a logical namespace which maps to one or more primary shards and can have zero or more replica shards.
- index alias
-
An index alias is a secondary name used to refer to one or more existing indices.
Most Elasticsearch APIs accept an index alias in place of an index name.
See Add index alias.
- index lifecycle
- The four phases an index can transition through: hot, warm, cold, and delete. For more information, see Index lifecycle.
- index lifecycle policy
- Specifies how an index moves between phases in the index lifecycle and what actions to perform during each phase.
- index pattern
-
A string that can contain the
*
wildcard to match multiple index names. In most cases, the index parameter in an Elasticsearch request can be the name of a specific index, a list of index names, or an index pattern. For example, if you have the indicesdatastream-000001
,datastream-000002
, anddatastream-000003
, to search across all three you could use thedatastream-*
index pattern. - index template
-
Defines settings and mappings to apply to new indexes that match a simple naming pattern, such as logs-*. An index template can also attach a lifecycle policy to the new index. Index templates are used to automatically configure indices created during rollover.
- leader index
- The source index for cross-cluster replication. A leader index exists on a remote cluster and is replicated to follower indices.
- local cluster
- The cluster that pulls data from a remote cluster in cross-cluster search or cross-cluster replication.
- mapping
-
A mapping is like a schema definition in a relational database. Each index has a mapping, which defines a type, plus a number of index-wide settings.
A mapping can either be defined explicitly, or it will be generated automatically when a document is indexed.
- node
-
A node is a running instance of Elasticsearch which belongs to a cluster. Multiple nodes can be started on a single server for testing purposes, but usually you should have one node per server.
At startup, a node will use unicast to discover an existing cluster with the same cluster name and will try to join that cluster.
- primary shard
-
Each document is stored in a single primary shard. When you index a document, it is indexed first on the primary shard, then on all replicas of the primary shard.
By default, an index has one primary shard. You can specify more primary shards to scale the number of documents that your index can handle.
You cannot change the number of primary shards in an index, once the index is created. However, an index can be split into a new index using the split API.
See also routing
- query
-
A request for information from Elasticsearch. You can think of a query as a question, written in a way Elasticsearch understands. A search consists of one or more queries combined.
There are two types of queries: scoring queries and filters. For more information about query types, see Query and filter context.
- recovery
-
Shard recovery is the process of syncing a replica shard from a primary shard. Upon completion, the replica shard is available for search.
Recovery automatically occurs during the following processes:
- Node startup or failure. This type of recovery is called a local store recovery.
- Primary shard replication.
- Relocation of a shard to a different node in the same cluster.
- Snapshot restoration.
- reindex
-
Copies documents from a source to a destination. The source and destination can be any pre-existing index, index alias, or data stream.
You can reindex all documents from a source or select a subset of documents to copy. You can also reindex to a destination in a remote cluster.
A reindex is often performed to update mappings, change static index settings, or upgrade Elasticsearch between incompatible versions.
- remote cluster
- A separate cluster, often in a different data center or locale, that contains indices that can be replicated or searched by the local cluster. The connection to a remote cluster is unidirectional.
- replica shard
-
Each primary shard can have zero or more replicas. A replica is a copy of the primary shard, and has two purposes:
- increase failover: a replica shard can be promoted to a primary shard if the primary fails
-
increase performance: get and search requests can be handled by primary or replica shards.
By default, each primary shard has one replica, but the number of replicas can be changed dynamically on an existing index. A replica shard will never be started on the same node as its primary shard.
- rollover
-
Creates a new index for a rollover target when the existing index reaches a certain size, number of docs, or age. A rollover target can be either an index alias or a data stream.
For example, if you’re indexing log data, you might use rollover to create daily or weekly indices. See the rollover index API.
- rollup
- Summarize high-granularity data into a more compressed format to maintain access to historical data in a cost-effective way.
- rollup index
- A special type of index for storing historical data at reduced granularity. Documents are summarized and indexed into a rollup index by a rollup job.
- rollup job
- A background task that runs continuously to summarize documents in an index and index the summaries into a separate rollup index. The job configuration controls what information is rolled up and how often.
- routing
-
When you index a document, it is stored on a single primary shard. That shard is chosen by hashing the
routing
value. By default, therouting
value is derived from the ID of the document or, if the document has a specified parent document, from the ID of the parent document (to ensure that child and parent documents are stored on the same shard).This value can be overridden by specifying a
routing
value at index time, or a routing field in the mapping. - searchable snapshot
- A snapshot of an index that has been mounted as a searchable snapshot index and can be searched as if it were a regular index.
- searchable snapshot index
- An index whose data is stored in a snapshot that resides in a separate snapshot repository such as AWS S3. Searchable snapshot indices do not need replica shards for resilience, since their data is reliably stored outside the cluster.
- shard
-
A shard is a single Lucene instance. It is a low-level “worker” unit which is managed automatically by Elasticsearch. An index is a logical namespace which points to primary and replica shards.
+ Other than defining the number of primary and replica shards that an index should have, you never need to refer to shards directly. Instead, your code should deal only with an index.
+ Elasticsearch distributes shards amongst all nodes in the cluster, and can move shards automatically from one node to another in the case of node failure, or the addition of new nodes.
- shrink
- Reduce the number of primary shards in an index. You can shrink an index to reduce its overhead when the request volume drops. For example, you might opt to shrink an index once it is no longer the write index. See the shrink index API.
- snapshot
- Captures the state of the whole cluster or of particular indices or data streams at a particular point in time. Snapshots provide a back up of a running cluster, ensuring you can restore your data in the event of a failure. You can also mount indices or datastreams from snapshots as read-only searchable snapshots.
- snapshot lifecycle policy
- Specifies how frequently to perform automatic backups of a cluster and how long to retain the resulting snapshots.
- snapshot repository
- Specifies where snapshots are to be stored. Snapshots can be written to a shared filesystem or to a remote repository.
- source field
-
By default, the JSON document that you index will be stored in the
_source
field and will be returned by all get and search requests. This allows you access to the original object directly from search results, rather than requiring a second step to retrieve the object from an ID. - system index
-
An index that contains configuration information or other data used internally by the system,
such as the
.security
index. The name of a system index is always prefixed with a dot. You should not directly access or modify system indices. - term
-
A term is an exact value that is indexed in Elasticsearch. The terms
foo
,Foo
,FOO
are NOT equivalent. Terms (i.e. exact values) can be searched for using term queries. - text
-
Text (or full text) is ordinary unstructured text, such as this paragraph. By default, text will be analyzed into terms, which is what is actually stored in the index.
Text fields need to be analyzed at index time in order to be searchable as full text, and keywords in full text queries must be analyzed at search time to produce (and search for) the same terms that were generated at index time.
- type
-
A type used to represent the type of document, e.g. an
email
, auser
, or atweet
. Types are deprecated and are in the process of being removed. See Removal of mapping types. - warm phase
- The second possible phase in the index lifecycle. In the warm phase, an index is generally optimized for search and no longer updated.
- warm tier
- A data tier that contains nodes that hold time series data that is accessed less frequently and rarely needs to be updated.