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 Mohammad Kasaei <mo...@gmail.com> on 2022/07/10 09:34:45 UTC

Lucene Disable scoring

Hello

I have a question. Is it possible to completely disable scoring in lucene?

Detailed description:
I have an index in elasticsearch and it contains big shards (every shard
about 500m docs) so a nano second of time spent on scoring every document
in any shard causes a few second delay in the query response.
I discovered that the most performant way to score documents is constant
score but the overhead of function calls can cause delay.
As a result I'm looking for a trick to ignore the function call and have
all no scoring on my whole query

Is it possible to ignore this step?

thanks a million

Re: Lucene Disable scoring

Posted by Adrien Grand <jp...@gmail.com>.
Note that Lucene automatically disables scoring already when scores are not
needed. E.g. queries that compute the top-k hits by score will definitely
compute scores, but if you are just counting the number of matches of a
query or aggregations, then Lucene skips scoring entirely already.

Is there something that leads you to believing that Lucene is computing
scores when it shouldn't?

On Mon, Jul 11, 2022 at 5:27 PM Mikhail Khludnev <mk...@apache.org> wrote:

> I'd rather agree with Uwe, but you can plug BooleanSimilarity just to check
> it out.
>
> On Mon, Jul 11, 2022 at 6:01 PM Mohammad Kasaei <
> mohammadkasaei00@gmail.com>
> wrote:
>
> > Hello
> >
> > I have a question. Is it possible to completely disable scoring in
> lucene?
> >
> > Detailed description:
> > I have an index in elasticsearch and it contains big shards (every shard
> > about 500m docs) so a nano second of time spent on scoring every document
> > in any shard causes a few second delay in the query response.
> > I discovered that the most performant way to score documents is constant
> > score but the overhead of function calls can cause delay.
> > As a result I'm looking for a trick to ignore the function call and have
> > all no scoring on my whole query
> >
> > Is it possible to ignore this step?
> >
> > thanks a million
> >
>
>
> --
> Sincerely yours
> Mikhail Khludnev
>


-- 
Adrien

Re: Lucene Disable scoring

Posted by Mikhail Khludnev <mk...@apache.org>.
I'd rather agree with Uwe, but you can plug BooleanSimilarity just to check
it out.

On Mon, Jul 11, 2022 at 6:01 PM Mohammad Kasaei <mo...@gmail.com>
wrote:

> Hello
>
> I have a question. Is it possible to completely disable scoring in lucene?
>
> Detailed description:
> I have an index in elasticsearch and it contains big shards (every shard
> about 500m docs) so a nano second of time spent on scoring every document
> in any shard causes a few second delay in the query response.
> I discovered that the most performant way to score documents is constant
> score but the overhead of function calls can cause delay.
> As a result I'm looking for a trick to ignore the function call and have
> all no scoring on my whole query
>
> Is it possible to ignore this step?
>
> thanks a million
>


-- 
Sincerely yours
Mikhail Khludnev

Re: Lucene Disable scoring

Posted by Uwe Schindler <uw...@thetaphi.de>.
No that's the only way to do it. The function call does not cost 
overheads because it is optimized away by the runtime.

Uwe

Am 10.07.2022 um 11:34 schrieb Mohammad Kasaei:
> Hello
>
> I have a question. Is it possible to completely disable scoring in lucene?
>
> Detailed description:
> I have an index in elasticsearch and it contains big shards (every shard
> about 500m docs) so a nano second of time spent on scoring every document
> in any shard causes a few second delay in the query response.
> I discovered that the most performant way to score documents is constant
> score but the overhead of function calls can cause delay.
> As a result I'm looking for a trick to ignore the function call and have
> all no scoring on my whole query
>
> Is it possible to ignore this step?
>
> thanks a million
>
-- 
Uwe Schindler
Achterdiek 19, D-28357 Bremen
https://www.thetaphi.de
eMail: uwe@thetaphi.de


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