lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Đạt Cao Mạnh <caomanhdat...@gmail.com>
Subject Re: Query needsScores
Date Mon, 29 Jun 2015 15:00:09 GMT
Hi Andrien,
I mean can we centralise the check of flag in one place create different
classes based on the checking?

On Mon, Jun 29, 2015 at 6:01 PM, Adrien Grand <jpountz@gmail.com> wrote:

> Actually passing the needsScore flag from collector to Weight is
> exactly why we did this change: collectors can now tell whether they
> need scores or not so that we can optimize query execution. Before we
> did this change, we had to rely on users to build an "optimized" query
> and for instance put a ConstantScoreQuery(TermFilter) in their
> MUST_NOT clauses instead of passing a simple TermQuery that would load
> norms and freqs even though it was not necessary.
>
> On Mon, Jun 29, 2015 at 12:36 PM, Đạt Cao Mạnh <caomanhdat317@gmail.com>
> wrote:
> > Hi Uwe,
> > But I think passing around needsScore flag from searcher, collector,
> query,
> > weight, scorer is not a neat solution.
> >
> > On Mon, Jun 29, 2015 at 5:29 PM, Uwe Schindler <uwe@thetaphi.de> wrote:
> >>
> >> Hi Dat,
> >>
> >>
> >>
> >> no we cannot remove that. In Lucene 5, Filters are deprecated and will
> >> disappear completely soon. Filtering is also done by the Query class (in
> >> fact the backwards compatibility abstract Filter class now extends
> Query).
> >> The needsScore is used to tell the Query if the consumer needs scores
> (e.g.,
> >> if you add a Query using BooleanClause.FILTER to a BooleanQuery).
> >>
> >>
> >>
> >> Uwe
> >>
> >>
> >>
> >> -----
> >>
> >> Uwe Schindler
> >>
> >> H.-H.-Meier-Allee 63, D-28213 Bremen
> >>
> >> http://www.thetaphi.de
> >>
> >> eMail: uwe@thetaphi.de
> >>
> >>
> >>
> >> From: Đạt Cao Mạnh [mailto:caomanhdat317@gmail.com]
> >> Sent: Monday, June 29, 2015 12:05 PM
> >> To: dev@lucene.apache.org
> >> Subject: Query needsScores
> >>
> >>
> >>
> >> In Lucene search, i see the check if(needsScores) in many places. Can we
> >> devide current queries to Query (that compute score) and Filter (that
> not
> >> compute score) and remove needsScores flag?
> >>
> >>
> >> --
> >>
> >> Best regards,
> >>
> >> Cao Mạnh Đạt
> >>
> >> D.O.B : 31-07-1991
> >> Cell: (+84) 946.328.329
> >> E-mail: caomanhdat317@gmail.com
> >>
> >> Hanoi University of Science and Technology
> >> School of information & communication technology
> >> Class : Computer Science K54
> >
> >
> >
> >
> > --
> > Best regards,
> > Cao Mạnh Đạt
> > D.O.B : 31-07-1991
> > Cell: (+84) 946.328.329
> > E-mail: caomanhdat317@gmail.com
> >
> > Hanoi University of Science and Technology
> > School of information & communication technology
> > Class : Computer Science K54
>
>
>
> --
> Adrien
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>


-- 
*Best regards,*
*Cao Mạnh Đạt*






*D.O.B : 31-07-1991Cell: (+84) 946.328.329E-mail: caomanhdat317@gmail.com
<caomanhdat317@gmail.com>Hanoi University of Science and TechnologySchool
of information & communication technologyClass : Computer Science K54*

Mime
View raw message