Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Elasticsearch Indexing

You're reading from  Elasticsearch Indexing

Product type Book
Published in Dec 2015
Publisher
ISBN-13 9781783987023
Pages 176 pages
Edition 1st Edition
Languages
Author (1):
Huseyin Akdogan Huseyin Akdogan
Profile icon Huseyin Akdogan

Chapter 2. What is an Elasticsearch Index

In the previous chapter, we looked at what the difference is when a field becomes indexed and searchable and at how the analysis process affects the relevant search results. In this chapter, we will dive deep into the concept of the Elasticsearch index. Therefore, we will first go through basic concepts. Then we will examine the inverted index data structure. By the end of this chapter, we will have covered the following topics:

  • What is dynamic mapping?

  • What is denormalization?

  • Is index flexible?

  • What is the inverted index?

Nature of the Elasticsearch index


Let's go through the basic concepts of Elasticsearch indices and their features.

Indices

Elasticsearch is document-oriented. Each record in Elasticsearch is a document. Elasticsearch uses JSON (JavaScript Object Notation) as the serialization format for documents. Therefore, each piece of data that is sent to Elasticsearch for indexing is a JSON document.

Tip

JSON is an open standard format that uses human-readable text to transmit data objects consisting of attribute–value pairs. If you want more information, please refer to https://en.wikipedia.org/wiki/JSON.

Elasticsearch indices compared to database management systems may be considered to be databases. How a database is a collection of regular information, Elasticsearch indices are a collection of structured JSON document. In other words, an index is a logical partition for user data.

Documents are stored in the same index of similar characteristics, for example, your member data in the member index, your...

Document


In the Elasticsearch world (that is, in Lucene world), a document is the main entity and basic unit of user data.

As mentioned earlier, the document format is JSON. Documents consist of fields (that is, properties) and value pairs. Each field has a name and a type supporting existing data types. A field is stored physically in a type within an index as an element of a document that has a unique ID.

Now, let's send a document to Elasticsearch:

curl -XPOST localhost:9200/premierleague/topscorer -d '{
  "fullname": "Robin van Persie",
  "age": 32,
  "birthdate": "1983-08-06",
"current_club": "Fenerbahce SK"
}'
{"_index":"premierleague","_type":"topscorer","_id":"AU8I47O90qdql2fUT1Oh","_version":1,"created":true}

As seen, we indexed the document without any preparation. Because Elasticsearch is schema-less, it does not request some definitions such as index, type, and field type before the indexing process.

Note

We'll discuss the question, "Is the claim about 'Elasticsearch stands for the...

Summary


In this chapter, we looked at the nature of the Elasticsearch index and reviewed the basic concepts: what dynamic mapping is, what it means, flexibility in the index, and what the inverted index is.

In the next chapter, you'll learn about the basic mapping concept: what basic mapping is, what the relationship between mapping and relevant search results is, Is the claim about 'Elasticsearch stands for the schema-free model' always true?, and some other subjects related to this topic.

lock icon The rest of the chapter is locked
You have been reading a chapter from
Elasticsearch Indexing
Published in: Dec 2015 Publisher: ISBN-13: 9781783987023
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}