Is this pattern recommended for a single index or multiple indices would be better w/ alias? The examples I see are usually adding one type of document to an index, so wondering if there is any performance benefit here.
What about dynamic vs static mapping? Any difference it has on indexing?
@ktech007 With dynamic mapping, Elasticsearch defines your mapping based on the structure of your incoming documents. This is helpful for exploring data even when you don't have the structure ahead of time. With explicit mapping, it allows you to have more control over how your documents will be structured. Here, you define the mapping that will be applied to all incoming documents.
Whether you use explicit or dynamic, the mapping is set upon ingestion and cannot be changed. If you want the documents to be structured in three different ways then that would require three different indices with their on corresponding mappings. Each index will have its own single mapping.
I think most people put "similar" documents in one index.
The main purpose is to be able to search for most relevant documents with the smallest set, which produces the fastest query.
And grouping similar documents into one index achieves this goal.
It's really your call on how you want to break up this logical set. And it often changes when your document count grows.
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.