0

I want to know as we have index creation feature in mognodb to speed up the query process https://docs.mongodb.org/v3.0/indexes/ what do we have for elasticsearch for this purpose? I googled it but I was unable to find any suitable information, I used indexing in mongodb on most frequently used fields to speed up the query process and now I want to do same in elasticsearch i want to know is there anything that elasticsearch provides .Thanks

swaheed
  • 3,671
  • 10
  • 42
  • 103

2 Answers2

0

Elasticsearch also has indices: https://www.elastic.co/blog/what-is-an-elasticsearch-index

They are also used as part of the database's key features to provide swift search capabilities.

AlexD
  • 4,062
  • 5
  • 38
  • 65
  • that's not i am asking indexing in Elasticsearch means create database and store data in it where as indexing in mongodb means create index on collection's most frequently used field to speed up the querying process . i want to know does elasticsearch have this kinda feature or not – swaheed Dec 24 '15 at 07:33
  • Try reading about Elasticsearch mappings, specifically about analyzed vs not_analyzed – AlexD Dec 24 '15 at 07:38
0

It is annoying that "index" is used in a different context with ES and many other databases. I'm not as familiar with MongoDB so I'll resort to their documentation at v3.0/core/index-types.

Basically Elasticsearch was designed to serve efficient "filtering" (yes/no queries) and "scoring" (relevance ranking via tf-idf etc.), and it uses Lucene as the underlying inverted index.

MongoDB concepts and their ES counter-parts:

  • Single Field Index: trivially supported, perhaps as not_analyzed fields for exact matching
  • Compound Index: Lucene applies AND filter condition via efficient bitmaps, can ad-hoc merge any "single field" indexes
  • Multikey Index: Transparent support, no difference values and an array of values
  • Geospatial Index: directly supported via geo-shapes
  • Text Index: In some way ES was optimized for this use-case as analyzed field type

In my view at search applications relevance is more important that plain filtering the results, as some words occur at almost every document and thus are less relevant when searching.

Elasticsearch has other very useful concepts as well such as aggregations, nested documents and child/parent relationships.

NikoNyrh
  • 3,578
  • 2
  • 18
  • 32