lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Willnauer (JIRA)" <>
Subject [jira] Commented: (LUCENE-2590) Enable access to the freq information in a Query's sub-scorers
Date Sat, 14 Aug 2010 19:59:17 GMT


Simon Willnauer commented on LUCENE-2590:

Mike, eventually we are getting this feature - I guess many are waiting for this!

I wonder if we really need to pass the BooleanClause.Occur to the visit method of if we rather
defined a visit method for each boolean relationship. We could make it an abstract class and
if you are not interested in Prohibited or Optional scorers you can simply leave the method
empty. JIT compiler might be able to optimize this method calls away. if we go this way I'd
make {{VisitSubScorer}} abstract  
public abstract class VisitSubScorer {
   public void visitRequired(Query parent, Query child, Scorer childScorer){}
   public void visitOptional(Query parent, Query child, Scorer childScorer){}
   public void visitProhibited(Query parent, Query child, Scorer childScorer){}

I we could also make parent and child <P extends Query, C extends Query, S extends Scorer>
in certain (I have to admit rather rare) situations this could make users code simpler as
they might know how their queries look like and the cast is done implicitly. For all others
nothing really changes though. Its just an idea and I thought I'd mention it.

> Enable access to the freq information in a Query's sub-scorers
> --------------------------------------------------------------
>                 Key: LUCENE-2590
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Search
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>         Attachments: LUCENE-2590.patch, LUCENE-2590.patch
> The ability to gather more details than just the score, of how a given
> doc matches the current query, has come up a number of times on the
> user's lists.  (most recently in the thread "Query Match Count" by
> Ryan McV on java-user).
> EG if you have a simple TermQuery "foo", on each hit you'd like to
> know how many times "foo" occurred in that doc; or a BooleanQuery +foo
> +bar, being able to separately see the freq of foo and bar for the
> current hit.
> Lucene doesn't make this possible today, which is a shame because
> Lucene in fact does compute exactly this information; it's just not
> accessible from the Collector.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message