Hi,
tl;dr; Currently Filter.getSuperTypes returns a set due to which the
ordering information about parent hierarchy is lost. For accurately
matching the indexRule in Lucene parent types need to be accessed in
ordered manner.
Usecase
-----------
While working on adding IndexingRule support to oak-lucene (OAK-2261)
I need to determine which IndexingRule should be used while evaluating
a query. The IndexingRule is required to determine if current index
is suitable to evaluate PropertyRestrictions which are part of the
query.
For example consider a case where a index is defined like below
{
"indexRules": {
"app:Asset": {
"properties": {
"type": {}
}
},
"nt:base": {
"properties": {
"size": {}
}
}
}
}
And we have a query
select * from [app:Asset] where size > 500
Then to answer if the above index definition can answer above query I
need to find the matching indexRule which is applicable for above
query. For that I need to fetch the superTypes for the given Query
filter and then walk upward the inheritance chain to to find the
closest match. And then use that to determine if that rule fullfill
query requirements or not.
In above case it would not fullfill as for app:Asset only the type
property would be indexed.
Current the Filter.getSuperTypes returns a set due to which the
ordering information is lost
Chetan Mehrotra