-
Notifications
You must be signed in to change notification settings - Fork 697
Description
Currently index term entries are:
't'
Would like to add support for also storing the position of this term in any arrays that were a part of the field path.
Not 100% decided that this must be in the key, but that would be the only way to have some hope of efficiently querying on this information.
The idea is to be able to further qualify queries and say that in addition to other query criteria, matching items must occur in the same parent element.
Consider the following documents in an index.
{
"name": "a",
"children": [
{
"name": "c",
"age": 25
},
{
"name": "d",
"age": 15
},
}
{
"name": "b",
"children": [
{
"name": "c",
"age": 15
},
{
"name": "d",
"age": 25
},
}
Logically we want to query:
child.name = "c" AND child.age < 20 AND same child
Both documents have a child named "c" and a child who's age is less than 25, but ONLY "b" satisfies both criteria in the same child.
The implementation idea is to include the position in the children array, and the query criteria "same child" is accomplished by verifying that matching items have the same value.