[
https://issues.apache.org/jira/browse/LUCENE-8747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16806528#comment-16806528
]
Alan Woodward commented on LUCENE-8747:
---------------------------------------
This patch adds two methods to Matches:
* getWeight() provides access to the Weight that created the Matches
* getSubMatches() returns a list of matches that constitute a composite Matches
object, or an empty list if the Matches was produced by a leaf query
This makes it easy to traverse the matching Weight tree, and means that you can
find which sub-queries have matched, or collect Explanations from sub-queries,
without having to iterate all term matches.
> Allow access to Weight and submatches from Matches instances
> ------------------------------------------------------------
>
> Key: LUCENE-8747
> URL: https://issues.apache.org/jira/browse/LUCENE-8747
> Project: Lucene - Core
> Issue Type: Improvement
> Reporter: Alan Woodward
> Assignee: Alan Woodward
> Priority: Major
> Attachments: LUCENE-8747.patch
>
>
> A Matches object currently allows access to all matching terms from a query,
> but the structure of the matching query is flattened out, so if you want to
> find which subqueries have matched you need to iterate over all matches,
> collecting queries as you go. It should be easier to get this information
> from the parent Matches object.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]