[ https://issues.apache.org/jira/browse/LUCENE-8849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17050460#comment-17050460 ]
Michele Palmia commented on LUCENE-8849: ---------------------------------------- I added a silly one-line patch to fix this. I chose FILTER instead of MUST as the rewritten query is really a filter. I tried to add a test but failed badly - _TestBooleanQuery_ for instance has a _testQueryVisitor()_ method that only tests the correctness of the visit, not whether the visit actually takes place at all. I would have tested this by mocking the _QueryVisitor_, but from what I could gather _Mockito_ is not available in core. Any suggestion on how to test this would be a great help! > DocValuesRewriteMethod.visit should visit the MTQ > ------------------------------------------------- > > Key: LUCENE-8849 > URL: https://issues.apache.org/jira/browse/LUCENE-8849 > Project: Lucene - Core > Issue Type: Bug > Components: core/search > Reporter: David Smiley > Priority: Minor > Attachments: LUCENE-8849.patch > > > The DocValuesRewriteMethod implements the QueryVisitor API (visit method) in > a way that surprises me. It does not visit the wrapped MTQ query. Shouldn't > it? Here is what I think it should do, similar to other query wrappers: > {code:java} > @Override > public void visit(QueryVisitor visitor) { > query.visit(visitor.getSubVisitor(BooleanClause.Occur.MUST, this)); > } > {code} > CC [~romseygeek] -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org