You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by sangrish <si...@gmail.com> on 2011/10/18 22:48:32 UTC

Access Document Score in Custom Function Query (ValueSource)

Hi,

     I use the following 2 components in ranking documents:

    "Normal Query" :  myField^2

    Custom Function Query(ValueSource): myFunc()

        In this value source I compute another score for every document
using some features. I want to  access the score of the query myField^2 
(for a given document) in this same value source.

Ideas?

Thanks
Sid



--
View this message in context: http://lucene.472066.n3.nabble.com/Access-Document-Score-in-Custom-Function-Query-ValueSource-tp3432459p3432459.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Access Document Score in Custom Function Query (ValueSource)

Posted by sangrish <si...@gmail.com>.
I understand that. Thanks. 

I just posted a related question , titled : "Access Score in Custom Function
Query " 

where (among other things) I am asking about the performance aspects of this
method. As you said, I need to execute "some" query first to create a
constrained recall set & then apply my custom function query (which in turn
executes another query) to it.

In my case I am using the same query again. First to create the recall set
(and also score the docs which I don't use though) and then execute that
query in my custom function to get the score. I am worried it may slow
things down.

Comments?

Thanks
Sid

--
View this message in context: http://lucene.472066.n3.nabble.com/Access-Document-Score-in-Custom-Function-Query-ValueSource-tp3432459p3478619.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Access Document Score in Custom Function Query (ValueSource)

Posted by Chris Hostetter <ho...@fucit.org>.
:         In this value source I compute another score for every document
: using some features. I want to  access the score of the query myField^2 
: (for a given document) in this same value source.
: 
: Ideas?

your ValueSource can wrap the score from the other query using a 
QueryValueSource.

just keep in mind that by definition function queries "match" every 
document in the index, so you'll still need to use the other query in some 
way (or use somehting like the "frange" parser to constrain the set of 
docs returned based on a range of values produced by your function)


-Hoss