Closed mikemccand closed 5 years ago
Returns 2 docs ["id00001", "id00003"]. It should only return "id00001" and not "id00003" here. Very strange behavior.
[Legacy Jira: Mikhail Khludnev (@mkhludnev) on Jul 03 2019]
My apologies. Thank you and I will pot something to the mailing list.
[Legacy Jira: Andrei on Jul 03 2019]
When I do a index-time join query on certain parent docs with a wildcard query for child docs, sometimes I get the wrong answer. Example:
1. program=P2
1. program=P2
So essentially I have 6 parent docs, doc 0 has no children, doc 1 has 1 child, doc 2 has 2 children, etc.
BitSetProducer parentSet = new QueryBitSetProducer(new TermInSetQuery("id", toSet("id00000", "id00001", "id00002", "id00003", "id00004", "id00005"))); Query q = new ToParentBlockJoinQuery(new TermInSetQuery("program", toSet("P1", "P2")), parentSet, ScoreMode.None);
Returns the correct result (4 docs: ["id00001", "id00002", "id00004", "id00005"]
BitSetProducer parentSet = new QueryBitSetProducer(new TermInSetQuery("id", toSet("id00000", "id00001", "id00002", "id00003", "id00004", "id00005"))); Query q = new ToParentBlockJoinQuery(new WildcardQuery(new Term("program", "*")), parentSet, ScoreMode.None);
BitSetProducer parentSet = new QueryBitSetProducer(new WildcardQuery(new Term("id", "*"))); Query q = new ToParentBlockJoinQuery(new WildcardQuery(new Term("program", "*")), parentSet, ScoreMode.None);
so far so good.
BitSetProducer parentSet = new QueryBitSetProducer(new TermInSetQuery("id", toSet("id00000", "id00001", "id00003"))); Query q = new ToParentBlockJoinQuery(new WildcardQuery(new Term("program", "*")), parentSet, org.apache.lucene.search.join.ScoreMode.None);
Returns 2 docs ["id00001", "id00003"]. It should only return "id00001" and not "id00003" here. Very strange behavior.
BitSetProducer parentSet = new QueryBitSetProducer(new TermQuery(new Term("id", "id00003"))); Query q = new ToParentBlockJoinQuery(new WildcardQuery(new Term("program", "*")), parentSet, org.apache.lucene.search.join.ScoreMode.None);
BitSetProducer parentSet = new QueryBitSetProducer(new TermInSetQuery("id", toSet( "id00003", "id00002"))); Query q = new ToParentBlockJoinQuery(new WildcardQuery(new Term("program", "*")), parentSet, org.apache.lucene.search.join.ScoreMode.None);
Gives the correct result ["id00002"]
I am attaching the unit test that demonstrates this: https://pastebin.com/aJ1LDLCS
I don't know if I am doing something wrong, or if there is an issue.
Thank you for looking into it.
Legacy Jira details
LUCENE-8902 by Andrei on Jul 02 2019, resolved Jul 03 2019