Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Elasticsearch  Indexing

You're reading from   Elasticsearch Indexing How to Improve User's Search Experience

Arrow left icon
Product type Paperback
Published in Dec 2015
Publisher
ISBN-13 9781783987023
Length 176 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Huseyin Akdogan Huseyin Akdogan
Author Profile Icon Huseyin Akdogan
Huseyin Akdogan
Arrow right icon
View More author details
Toc

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...

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 €18.99/month. Cancel anytime