Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
4.9
-
None
-
None
-
New
Description
For now ToParentBlockJoinQuery accepts only child
documents. Before (LUCENE-4968) passing parent document to TPBJQ lead to
undefined behavior and garbage in results, unfortunately it also affects
TPBJQ.advance(). After pointed patch IllegalStateException is
thrown when this occurs.
So we must always take parent-child relations into account while writing
queries. At most of time it is necessary when writing a query, but sometimes,
filters can be independent of data model (for example, ACL filters:
+TPBJQ +allowed:user).
TPBJQ shall returns parent doc if parent doc is passed to TPBJQ.advance()
or returned from childScorer.advance(). This change doesn't break anything:
results will be absolutely the same for parent-child orthogonal queries.
In few words: Document matching parent filter should be parent of itself.