A
A
Anton Ivanov2016-12-07 10:34:11
elasticsearch
Anton Ivanov, 2016-12-07 10:34:11

How to explain in simple terms what is index and type in elasticsearch?

Hello!
The question is in the title.
The explanation that the index should be understood as a base, and the type as a table in this database, does not seem particularly good to me, since now there is a restriction in elastic that within the same index, but in different types, there cannot be one field with different type of data. That is, if it was like this: in /orders/orderthe field id- this is a number, and in /orders/comments- a string, then, with the second, it seems, version of elastic, you can no longer do this. id must be of the same type. For a regular DBMS, there are no such restrictions.
Now, for myself, I understand the type as another kind of filter. For example, I have an index /log. And as a type, I use the source of this log. That is, /log/api_request, /log/user_actionand so on. The structure of the document is the same, it's just that not all fields are used in some types.
So, after all, what is an index and a type? :)
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Max, 2016-12-19
@MaxDukov

IMHO an index is more of a data structure. How data is stored, how it is analyzed, in what format, etc.
type - he is a type. How data is stored and how you can work with it later. A banal example is the price saved by default as a string. No Sum/Everage/Min/Max can be done with it later without reindexing.
https://www.elastic.co/guide/en/elasticsearch/refe...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question