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 sidhant92 <si...@hotmail.com> on 2017/01/13 17:08:24 UTC

Get values in custom scoring during document retrieval

I am using custom score provider for scoring lucene documents manually. I am
doing many calculations in custom score provider to calculate the score. For
example on of them is distance. So now once the scoring is done i would like
to know that distance as well. Instead of computing it again cant i directly
get that value after scoring as its already calculated.



--
View this message in context: http://lucene.472066.n3.nabble.com/Get-values-in-custom-scoring-during-document-retrieval-tp4313853.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.

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


Re: Get values in custom scoring during document retrieval

Posted by Uwe Schindler <uw...@thetaphi.de>.
Hi,

For display you generally would only calculate it for a few documents and not all. So why do you think it's a problem?

You cannot store values somewhere in the scorer for use during document retrieval.

Uwe

Am 17. Januar 2017 20:40:32 MEZ schrieb sidhant92 <si...@hotmail.com>:
>Okay say i need the distance for filtering purposes. And then again i
>need
>the distance for scoring purposes. I also need the distance for display
>purposes and i display some 100 results. So are you sayings its still
>okay
>to compute the distance twice here once for scoring and once for
>display
>rather than storing the distances somewhere when doing the custom
>scoring?
>
>
>
>--
>View this message in context:
>http://lucene.472066.n3.nabble.com/Get-values-in-custom-scoring-during-document-retrieval-tp4313853p4314417.html
>Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>For additional commands, e-mail: java-user-help@lucene.apache.org

--
Uwe Schindler
Achterdiek 19, 28357 Bremen
https://www.thetaphi.de

Re: Get values in custom scoring during document retrieval

Posted by sidhant92 <si...@hotmail.com>.
Okay say i need the distance for filtering purposes. And then again i need
the distance for scoring purposes. I also need the distance for display
purposes and i display some 100 results. So are you sayings its still okay
to compute the distance twice here once for scoring and once for display
rather than storing the distances somewhere when doing the custom scoring?



--
View this message in context: http://lucene.472066.n3.nabble.com/Get-values-in-custom-scoring-during-document-retrieval-tp4313853p4314417.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.

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


Re: Get values in custom scoring during document retrieval

Posted by Adrien Grand <jp...@gmail.com>.
Sorry I just saw your other message that has a bit more information.
Actually you do not need the distance for displaying purposes but both for
filtering and custom scoring. That said, I think recomputing the distances
is still the way to go. Geo-distance filters have optimizations that allow
them to find matching documents without computing distances at all most of
time, so computing the distance for your scoring function may not waste CPU
since the distance was not computed for filtering.

Le mar. 17 janv. 2017 à 19:36, Adrien Grand <jp...@gmail.com> a écrit :

> Maybe recomputing the distance is not too bad? Say you have millions of
> documents and only ask for the top 100, then recomputing distances for that
> top 100 would be much cheaper than what you already had to do to compute
> the scores.
>
> Le ven. 13 janv. 2017 à 18:08, sidhant92 <si...@hotmail.com> a écrit :
>
> I am using custom score provider for scoring lucene documents manually. I
> am
> doing many calculations in custom score provider to calculate the score.
> For
> example on of them is distance. So now once the scoring is done i would
> like
> to know that distance as well. Instead of computing it again cant i
> directly
> get that value after scoring as its already calculated.
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Get-values-in-custom-scoring-during-document-retrieval-tp4313853.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: Get values in custom scoring during document retrieval

Posted by Adrien Grand <jp...@gmail.com>.
Maybe recomputing the distance is not too bad? Say you have millions of
documents and only ask for the top 100, then recomputing distances for that
top 100 would be much cheaper than what you already had to do to compute
the scores.

Le ven. 13 janv. 2017 à 18:08, sidhant92 <si...@hotmail.com> a écrit :

> I am using custom score provider for scoring lucene documents manually. I
> am
> doing many calculations in custom score provider to calculate the score.
> For
> example on of them is distance. So now once the scoring is done i would
> like
> to know that distance as well. Instead of computing it again cant i
> directly
> get that value after scoring as its already calculated.
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Get-values-in-custom-scoring-during-document-retrieval-tp4313853.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>