I have Elasticsearch documents which looks like below :
MetaData metadata,
... many other properties...
MetaData class :
public class MetaData {
private List<String> keywords;
}
Now I want to build a query which match the provided string to the metadata.keywords's 0 index.
Code example : metadata.keywords[0] equals to input string
What I have done is below :
BoolQueryBuilder query = QueryBuilders.boolQuery();
query.must(QueryBuilders.existsQuery("metadata.keywords"));
How can I specify the index to do the same?