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

Understanding the schema-less


Certainly one of the most important features of Elasticsearch is its ability to be schema-less but it must be digested with no doubt.

Yes, as stated previously, Elasticsearch does not require some definitions such as index, type, and field type before the indexing process, and when an object is indexed later with a new property, it will automatically be added to the mapping definitions.

So, is the claim about "Elasticsearch stands for the schema-free model" always true?

Recall that types are being created according to the mapping information and mapping is actually a schema definition. Therefore, Elasticsearch expects that mapping and the documents being indexed are compatible.

Now let's examine the following example:

curl -XPUT localhost:9200/my_index/document/1 -d '{"value": "a"}'
{"_index":"my_index","_type":"document","_id":"1","_version":1,"created":true}

curl -XPUT localhost:9200/my_index/document/2 -d '{"value": 1}'
{"_index":"my_index","_type":"document...
lock icon The rest of the chapter is locked
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}