ElasticSearch — Inverted Index, Source, Index, Norms, Routing…

Photo by Ryan Geller on Unsplash

Lucene vs ElasticSearch

  • Lucene is a Java library
  • ElasticSearch is built over Lucene and provides a JSON based REST API to refer to Lucene features.
  • Elasticsearch provides a distributed system (which is something Lucene is not capable of) on top of Lucene.
  • Elasticsearch provides other supporting features like monitoring and management APIs.

What is Inverted Index?

Sample documents and resulting inverted index — elastic.co

What are _source and source?

{
"_source" : {
"enabled" : false
},
"properties": {
"organizationId": {
"type": "keyword"
},
"accountId": {
"type": "keyword"
},
"type": {
"type": "text",
"analyzer": "whitespace"
}
}
}
"_source": [ "field1.*", "field2.*" ],
  • no declaration at the top of index mapping file for “_source” (all fields’ values are already part of the “_source” field, which is stored by default.)
  • it is declared in field “_source” (like “_source”: [ “field1.*”, “field2.*” ] example)
  • you disabled it by setting “_source” : { “enabled” : false },” but set this field’s “store” option as “true”

What is index?

{   
"foo": {
"type": "text",
"index": true
}
}
{   
"foo": {
"type": "keyword",
"index": true
}
}

What is norms?

"properties": {
"title": {
"type": "text",
"norms": false
}
}

Nodes & Shards

  • An Elasticsearch node contains shards.
  • A single Elasticsearch index is spread across nodes using shards.
  • Each shard holds a partition of the documents in the Elasticsearch index.
  • Each one of these shards is an instance of Lucene.

What is routing?

{
"_routing": {
"required": true
},
"properties": {
"organizationId": {
"type": "keyword"
},
"accountId": {
"type": "keyword"
}
}

I would love to change the world, but they won’t give me the source code | coding 👩🏼‍💻 | coffee ☕️ | jazz 🎷 | anime 🐲 | books 📚 | drawing 🎨

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Asset Management and Beyond: JEAM

Linux Network File System (NFS)

Basic Docker Containers to Kubernetes

Linear regression using Least Squares

Blog #8 CS373 Fall 2021

A Year's Experience of Interning At An Open Source Software Company

CS373 Spring 2022: Joriann Bassi

All the issues with HTML, the Frontend land where time stood still

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Nil Seri

Nil Seri

I would love to change the world, but they won’t give me the source code | coding 👩🏼‍💻 | coffee ☕️ | jazz 🎷 | anime 🐲 | books 📚 | drawing 🎨

More from Medium

Spring Data and Redis Keys

Used dropbox/drive to upload files?

Elasticsearch In A Nutshell Pa

Things to Know about Authentication/Authorization protocols!