we run into following problem, maybe you can give us some adivce or best practice:
We use many indices (80) and for search we use one alias to query all of them at the same time as search results can be in found in any index and should be returned together.
The reason for this many indices is that every index has different fields, so using only one index (e.g. with different types) would result in sparsity and a huge number of fields ( > 1.000) (which is not recommented by Elastic).
However, with using many indices our search perfomance is very poor (around 5 - 10 seconds).
Any advice on this? Is it bad to use so many indices and adress all together in one search? Any other hints where to look to improve search performance?
we have one type + 2 child-types per index. Every "type" on every index has a few fields in common and many different fields, that's the reason why we split it into many indices instead of using only one index.
Do you mean, even then search across multiple indices it would be wise to have all fields present? When searching, all field names are always part of the query even if they do not exist in the particular index. Is this bad?
As long as you have the common fields across Types, which are part of your search query you should be good. For e.g. Type A in Index 1 can have 20 fields and Type B in Index 2 can have 10 fields. But there should be common set of fields across Types (A & B) across indices (Index 1 & 2) which you are searching on.
Are queries being slow or is there a particular query which is slow?
Try specifying the fields on which the search should happen and see the results. For e.g. if you want to search on fields 1,2,3 from Type A and fields 4,5,6 from Type B specify them in query like
[type1.field1, type1.field2,type2.field4] etc.
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.