How can I delete the entity from Elastic-search if i don't know exact index name?

88 Views Asked by At

I have indexes in elastic-search which are named as follows-

  1. indexName-2017-01-25
  2. indexName-2017-01-24
  3. indexName-2017-01-23
  4. ...and so on

All above indexes has same 'type', lets say "indexType".

Now I want to delete a record with a given "id" which might be present in any of the above indexes and user of my API will provide me following-

  1. id of the entity to be deleted.
  2. Index prefix i.e. "indexName-*".
  3. type of index i.e. "indexType".

How can I write a query in JAVA to delete an entity with given above information?

0

There are 0 best solutions below