Searching across multiple indices vs 2 indices requests on a single indice

Hello,

my data model is centered around a concept that shapes the indices names (for easier filtering on this concept). I have 3 types of indices per concept : start, wip, end. So indices look like that:
start-concept-a, wip-concept-a, end-concept-a and same goes for concept-b and so on.

Now there is one additionnal thing. A document ID is always unique across all indices of the same type (I cannot have id1 tied to concept-a and concept-b). This is implemented on the layer above elasticsearch itself (a java api that adds a bit of business logic and simplifies calls to elasticsearch for the end user).

One last important thing, there is a lookup indice to match every document ID against a concept.

Now that I tried to explain my data model, here comes the question:
What is the most efficient between these 2 ways of getting a list of items by ID stored under the same type of indice (say, indices starting with start-*) :

  • For each ID in the list, check on what indice it is stored using a GET by ID on the lookup indice, then fetch the document on the proper indice (say, start-concept-a).
  • make a GET request on start-*

I hope I was clear enough, if not, I would be glad to try and explain more clearly.

thanks,

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.