- Elasticsearch 7.0 Cookbook(Fourth Edition)
- Alberto Paro
- 300字
- 2021-06-24 14:52:15
Basic Operations
Before we start with indexing and searching in Elasticsearch, we need to cover how to manage indices and perform operations on documents. In this chapter, we'll start by discussing different operations on indices, such as create, delete, update, open, and close. These operations are very important because they allow you to define the container (index) that will store your documents. The index create/delete actions are similar to the SQL create/delete database commands.
After the indices management part, we'll learn how to manage mappings to complete the discussion we started in the previous chapter and to lay down the basis for the next chapter, which is mainly centered on searching.
A large portion of this chapter is dedicated to create-read-update-delete (CRUD) operations on records that are at the core of record storing and management in Elasticsearch.
To improve indexing performance, it's also important to understand bulk operations and avoid their common pitfalls.
This chapter doesn't cover operations involving queries, as this is the main theme of Chapter 4, Exploring Search Capabilities, Chapter 5, Text and Numeric Queries, and Chapter 6, Relationships and Geo Queries, as well as cluster operations, which will be discussed in Chapter 9, Managing Clusters and Nodes, because they are mainly related to control and monitoring the cluster.
In this chapter, we will cover the following recipes:
- Creating an index
- Deleting an index
- Opening or closing an index
- Putting a mapping in an index
- Getting a mapping
- Reindexing an index
- Refreshing an index
- Flushing an index
- ForceMerge an index
- Shrinking an index
- Checking if an index exists
- Managing index settings
- Using index aliases
- Rolling over an index
- Indexing a document
- Getting a document
- Deleting a document
- Updating a document
- Speeding up atomic operations (bulk operations)
- Speeding up GET operations (multi GET)