I am using elasticsearch 5.4.1.
I create queries using JAVA API and until now we had 5 indexes.
I always searched all 5 of the indexes and in order to achieve this, I didn't send index names with the search request.
Now we are going to add a 6 index and now there are 2 usecases:
- search the 6th index alone - just send its name with the search request.
- search all indexes excluding the 6th.
I can't give the 5 indexes names hardcoded in the request since they are deleted and created dynamically by the system (with random names).
So I need to maintain a list of indices in memory and modify this list when it changes in ES.
I don't like this so much and wanted to have an API in JAVA that can tell ES to search all indexes except the 6th (that has a constant name).
Can it be done?