You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Rajnish kamboj <ra...@gmail.com> on 2017/01/09 11:17:58 UTC

Disabling Lucene Scoring/Ranking

My application does not require scoring/ranking.  All data is equally
important for me.

Search query can return any documents matching search criteria.

So, Is there a way to completely disable scoring/ranking altogether?
OR Is there a better solution to it.

Regards
Rajnish

Re: Disabling Lucene Scoring/Ranking

Posted by Michael McCandless <lu...@mikemccandless.com>.
Just wrap your Query in a ConstantScoreQuery.  Lucene will optimize
the query execution to not read term frequencies from disk, not
compute scores, etc.

Mike McCandless

http://blog.mikemccandless.com


On Mon, Jan 9, 2017 at 6:17 AM, Rajnish kamboj <ra...@gmail.com> wrote:
> My application does not require scoring/ranking.  All data is equally
> important for me.
>
> Search query can return any documents matching search criteria.
>
> So, Is there a way to completely disable scoring/ranking altogether?
> OR Is there a better solution to it.
>
> Regards
> Rajnish

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Disabling Lucene Scoring/Ranking

Posted by Michael McCandless <lu...@mikemccandless.com>.
In most cases, it should.

Test it and find out and report back :)

Mike McCandless

http://blog.mikemccandless.com


On Mon, Jan 9, 2017 at 10:07 AM, Rajnish kamboj
<ra...@gmail.com> wrote:
> Thanks for quick responses..
> I will try the approach..
>
> Does bypassing scoring increases search performance also?
>
>
> Regards
> Rajnish
>
> On Monday, January 9, 2017, Ian Lea <ia...@gmail.com> wrote:
>
>> oal.search.ConstantScoreQuery?
>>
>> "A query that wraps another query and simply returns a constant score equal
>> to the query boost for every document that matches the query. It therefore
>> simply strips of all scores and returns a constant one."
>>
>>
>> --
>> Ian.
>>
>>
>> On Mon, Jan 9, 2017 at 11:39 AM, Taher Galal <taher.galal90@gmail.com
>> <javascript:;>>
>> wrote:
>>
>> > Hi,
>> >
>> > What about writing your own scoring that just give a value of 1 to all
>> the
>> > documents that are hits?
>> >
>> > On Mon, Jan 9, 2017 at 12:17 PM, Rajnish kamboj <
>> rajnishk7.info@gmail.com <javascript:;>>
>> > wrote:
>> >
>> > > My application does not require scoring/ranking.  All data is equally
>> > > important for me.
>> > >
>> > > Search query can return any documents matching search criteria.
>> > >
>> > > So, Is there a way to completely disable scoring/ranking altogether?
>> > > OR Is there a better solution to it.
>> > >
>> > > Regards
>> > > Rajnish
>> > >
>> >
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Disabling Lucene Scoring/Ranking

Posted by Rajnish kamboj <ra...@gmail.com>.
Thanks for quick responses..
I will try the approach..

Does bypassing scoring increases search performance also?


Regards
Rajnish

On Monday, January 9, 2017, Ian Lea <ia...@gmail.com> wrote:

> oal.search.ConstantScoreQuery?
>
> "A query that wraps another query and simply returns a constant score equal
> to the query boost for every document that matches the query. It therefore
> simply strips of all scores and returns a constant one."
>
>
> --
> Ian.
>
>
> On Mon, Jan 9, 2017 at 11:39 AM, Taher Galal <taher.galal90@gmail.com
> <javascript:;>>
> wrote:
>
> > Hi,
> >
> > What about writing your own scoring that just give a value of 1 to all
> the
> > documents that are hits?
> >
> > On Mon, Jan 9, 2017 at 12:17 PM, Rajnish kamboj <
> rajnishk7.info@gmail.com <javascript:;>>
> > wrote:
> >
> > > My application does not require scoring/ranking.  All data is equally
> > > important for me.
> > >
> > > Search query can return any documents matching search criteria.
> > >
> > > So, Is there a way to completely disable scoring/ranking altogether?
> > > OR Is there a better solution to it.
> > >
> > > Regards
> > > Rajnish
> > >
> >
>

Re: Disabling Lucene Scoring/Ranking

Posted by Ian Lea <ia...@gmail.com>.
oal.search.ConstantScoreQuery?

"A query that wraps another query and simply returns a constant score equal
to the query boost for every document that matches the query. It therefore
simply strips of all scores and returns a constant one."


--
Ian.


On Mon, Jan 9, 2017 at 11:39 AM, Taher Galal <ta...@gmail.com>
wrote:

> Hi,
>
> What about writing your own scoring that just give a value of 1 to all the
> documents that are hits?
>
> On Mon, Jan 9, 2017 at 12:17 PM, Rajnish kamboj <ra...@gmail.com>
> wrote:
>
> > My application does not require scoring/ranking.  All data is equally
> > important for me.
> >
> > Search query can return any documents matching search criteria.
> >
> > So, Is there a way to completely disable scoring/ranking altogether?
> > OR Is there a better solution to it.
> >
> > Regards
> > Rajnish
> >
>

Re: Disabling Lucene Scoring/Ranking

Posted by Taher Galal <ta...@gmail.com>.
Hi,

What about writing your own scoring that just give a value of 1 to all the
documents that are hits?

On Mon, Jan 9, 2017 at 12:17 PM, Rajnish kamboj <ra...@gmail.com>
wrote:

> My application does not require scoring/ranking.  All data is equally
> important for me.
>
> Search query can return any documents matching search criteria.
>
> So, Is there a way to completely disable scoring/ranking altogether?
> OR Is there a better solution to it.
>
> Regards
> Rajnish
>

Re: Disabling Lucene Scoring/Ranking

Posted by Mikhail Khludnev <mk...@apache.org>.
fwiw https://issues.apache.org/jira/browse/LUCENE-5867 is going to be
released soon.

On Mon, Jan 9, 2017 at 2:17 PM, Rajnish kamboj <ra...@gmail.com>
wrote:

> My application does not require scoring/ranking.  All data is equally
> important for me.
>
> Search query can return any documents matching search criteria.
>
> So, Is there a way to completely disable scoring/ranking altogether?
> OR Is there a better solution to it.
>
> Regards
> Rajnish
>



-- 
Sincerely yours
Mikhail Khludnev