From ES document I understood that index is like database and document type is like table. Every table has its own indexes.
Let's suppose we have one ES index with two document types (posts and book) and we have 1000000000 posts and 30 books. If I search for some text expression in ONLY books will my query be very fast or slow? By other words - documents of different types are indexed via one index or for every document type separate index is created?
From ES document I understood that index is like database and document
type is like table. Every table has its own indexes.
Let's suppose we have one ES index with two document types (posts and
book) and we have 1000000000 posts and 30 books. If I search for some text
expression in ONLY books will my query be very fast or slow? By other
words - documents of different types are indexed via one index or for every
document type separate index is created?
You can mix types in a single index, but we recommend you separate them out.
Obviously a search against 30 docs is a lot faster than one against 1 billion.
On 20 March 2015 at 13:08, Александр Свиридов < ooo_saturn7@mail.ru > wrote:
From ES document I understood that index is like database and document type is like table. Every table has its own indexes.
Let's suppose we have one ES index with two document types (posts and book) and we have 1000000000 posts and 30 books. If I search for some text expression in ONLY books will my query be very fast or slow? By other words - documents of different types are indexed via one index or for every document type separate index is created?
Thanks, I find this to be useful context. However, I don't find a direct explanation for the reasons why separate indices are preferred over a single index with multiple types.
There are some data modeling implications that are mentioned (field name, storage of sparse fields, scoring). This to me suggests there may be times where the index + types model is useful (and your cited article says as much).
My reading of the above statement recommends that multiple types not be present in an index, suggesting that the index + types model may not be so useful, more or less in the form: "Don't mix types in a single index because $badthing."
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.