The mapping contains nested field.
I'm wondering if it's possible to do an exact match on "value" without changing its type to "keyword".
"mappings": {
"properties": {
"tag": {
"type": "nested",
"properties": {
"value": {
"type": "text"
},
"key": {
"type": "keyword"
}
}
}
}
}
Below is the code I tried to do an exact match on "value" field.
BoolQueryBuilder boolQ = boolQuery();
boolQ.must(matchQuery("tag.key", "key"));
boolQ.must(matchQuery("tag.value", "value").fuzziness(Fuzziness.ZERO));
entireQuery.must(nestedQuery("tag", boolQ, ScoreMode.None));
The above returned a result matched with tokenized words of "value" as well.
I would really appreciate if any references related to the question is present.