Indexing a document
In Elasticsearch there are two vital operations: index and search.
Indexing means storing one or more documents in an index: a similar concept of inserting records in a relational database.
In Lucene, the core engine of Elasticsearch, inserting or updating a document has the same cost: in Lucene and Elasticsearch update means replace.
Getting ready
You need an up-and-running Elasticsearch installation, as used in the Downloading and installing Elasticsearch recipe in Chapter 2, Downloading and Setup.
To execute curl
via the command line, you need to install curl
for your operative system.
To correctly execute the following commands, use the index and mapping created in the Putting a mapping in an index recipe.
How to do it...
To index a document, several REST entry points can be used:
Method |
URL |
|
|
|
|
|
|