You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "David Smiley (JIRA)" <ji...@apache.org> on 2018/07/06 14:56:00 UTC
[jira] [Commented] (LUCENE-8229) Add a method to Weight to retrieve
matches for a single document
[ https://issues.apache.org/jira/browse/LUCENE-8229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16534937#comment-16534937 ]
David Smiley commented on LUCENE-8229:
--------------------------------------
I was just looking at Matches.MatchesIteratorSupplier. It's a shame to need mirror images of existing java.util.function interfaces that only differ in that it throws IOException. See org.apache.lucene.util.IOUtils.IOConsumer added by [~simonw] recently. I propose that we add an IOSupplier here and get rid of MatchesIteratorSupplier (in a new issue of course). WDYT? We ought to have a consistent approach in Lucene to this scenario. I've wanted an IOSupplier in Solr for something recently and saw it hadn't been added yet.
> Add a method to Weight to retrieve matches for a single document
> ----------------------------------------------------------------
>
> Key: LUCENE-8229
> URL: https://issues.apache.org/jira/browse/LUCENE-8229
> Project: Lucene - Core
> Issue Type: New Feature
> Reporter: Alan Woodward
> Assignee: Alan Woodward
> Priority: Major
> Fix For: 7.4
>
> Attachments: LUCENE-8229.patch, LUCENE-8229_small_improvements.patch
>
> Time Spent: 5h 20m
> Remaining Estimate: 0h
>
> The ability to find out exactly what a query has matched on is a fairly frequent feature request, and would also make highlighters much easier to implement. There have been a few attempts at doing this, including adding positions to Scorers, or re-writing queries as Spans, but these all either compromise general performance or involve up-front knowledge of all queries.
> Instead, I propose adding a method to Weight that exposes an iterator over matches in a particular document and field. It should be used in a similar manner to explain() - ie, just for TopDocs, not as part of the scoring loop, which relieves some of the pressure on performance.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org