5 Working with documents

 

This chapter covers

  • Indexing, retrieving, and reindexing documents
  • Manipulating and tweaking responses
  • Updating and deleting documents with APIs and query methods
  • Working with scripted updates
  • Indexing documents in bulk

It is time to work with and understand operations on documents in Elasticsearch. Documents are indexed, fetched, updated, or deleted based on our requirements. We can load data into Elasticsearch from stores such as databases and files or from real-time streams. Similarly, we can update or modify data that exists in Elasticsearch. If needed, we can even delete and purge documents. For example, we may have a product catalog database that needs to be imported into Elasticsearch to enable search capabilities on products.

Elasticsearch exposes a set of APIs for working with our documents:

  • Document indexing APIs—To index documents into Elasticsearch
  • Read and search APIs—To allow clients to fetch/search documents
  • Update APIs—To edit and modify the fields of a document
  • Delete APIs—To remove documents from the store

5.1 Indexing documents

 
 

5.1.1 Document APIs

 

5.1.2 Mechanics of indexing

 
 

5.1.3 Customizing the refresh process

 

5.2 Retrieving documents

 
 

5.2.1 Using the single-document API

 
 
 
 

5.2.2 Retrieving multiple documents

 
 

5.2.3 The ids query

 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest