Hi have a field that is analyzed using the path_hierarchy
tokenizer. My problem is that, if I have a path like this:
parent/child1/child2
When I execute a search using this query:
POST my_index/_search
{
"query": {
"term": {
"path": {
"value": "parent/child1"
}
}
}
}
I get all the documents with the form parent/child1/<child2_name>
with the same score as the document that is an exact match of parent/child1
(no child2
), and I need to guarantee that the document that is an exact match is at the top of the results, but I need the path_hierarchy
tokenizer for other search cases. What would be the best way to achieve this?
Help is really appreciated.