Hello Igor, Accessing a potential match during scoring is problematic. Piggibacking on wrapped boolean query is not an option because when a certain docId is collected matching legs might reside on previous or next docID. You can check these for the inspiration https://lucene.apache.org/core/9_0_0/queries/org/apache/lucene/queries/function/FunctionMatchQuery.html https://lucene.apache.org/core/9_0_0/queries/org/apache/lucene/queries/function/valuesource/QueryValueSource.html https://lucene.apache.org/core/9_0_0/queries/org/apache/lucene/queries/function/FunctionScoreQuery.html
On Mon, Jul 17, 2023 at 8:13 PM Igor Kustov <kustoffi...@gmail.com> wrote: > I'm writing custom lucene query which is basically a wrapper around boolean > query with many should clauses. > > I want to access this boolean query's matched terms, and then either filter > out this document depending on external statistics on those terms or > proceed with this document without affecting it boolean score. > > What is the best way to achieve this? > -- Sincerely yours Mikhail Khludnev