iprithv commented on PR #16175: URL: https://github.com/apache/lucene/pull/16175#issuecomment-4623617852
thanks @javanna for pointing me to #14756. I reverted to visit both queries and use max(indexQuery, dvQuery) so for finalization, I tried using repeated getSubVisitor calls as variant boundaries (calling getSubVisitor(MUST, this) before both indexQuery.visit() and dvQuery.visit()) which will allow the counting visitor to detect when one variant ends and another begins, and keep track of the maximum clause count across variants. issue I ran into is that the current QueryVisitor API doesn't seem to provide a clean way to know when an IndexOrDocValuesQuery subtree has finished visiting. I tried these, finalizing when a subsequent non-IODVQ getSubVisitor call is seen. so this works unless the IODVQ is the last visited clause. closeable counting visitor with finalization in IndexSearcher.rewrite(). so this one works, but changes when exceptions are thrown. and stack-based tracking for nested IODVQs. this one handles nesting correctly, but still requires an external finalization mechanism. so far I haven't found a best way to apply baseline + max(variants) in all cases without introducing additional complexity or relying on behavior outside the current visitor contract. I may be missing something in the approach though. did you have a different mechanism in mind for handling the finalization/counting? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
