Hi guys,
Here are some sample documents:
{
"id": 1,
"path": "a/b/c"
}
{
"id": 2,
"path": "a/b/d"
}
{
"id": 3,
"path": "a/d/c"
}
I need to be able to search for documents whose path is under "a" (docs 1, 2, 3), or "a/b" (docs 1, 2). I can do that by using a path_hierarchy tokenizer on the path field, and then using a terms query. This works great and runs very fast.
Now I also need to run a query that would return all documents under "a" with the last level being "c" (docs 1 and 3). I can use a wildcard query (something like "a/*/c"), but I'm wondering if there's a more efficient option since the wildcard query can be slow.
Thank you in advance.