How to do custom scoring using query parameters?

2011-06-01 Thread ngaurav2005
Hi All,

We need to score documents based on some parameters received in query
string. Since this was not possible via function query as we need to use
"if" condition, which can be emulated through map function, but one of the
output values of "if" condition has to be function, where as map only
accepts constants. So if I rephrase my requirements, it would be:

1. Calculate score for each document using query parameters(search
parameters)
2. Sort these documents based on score

So I know that I can change default scoring by overriding DefaultSimilarity
class, but how does this class can receive query parameters, which are
required for score calculation. Also, once score is calculated, how can I
sort those results based on scores?

Regards,
Gaurav

--
View this message in context: 
http://lucene.472066.n3.nabble.com/How-to-do-custom-scoring-using-query-parameters-tp3013788p3013788.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Change default scoring formula

2011-06-01 Thread ngaurav2005
Thanks Tomas. Well I am sorting results by a function query. I donot want
solr to do extra effort in calculating score for each document and eat up my
cpu cycles. Also, I need to use "if" condition in score calculation, which I
emulated through "map" function, but map function do not accept a function
as one of the values. This causes me to write my own scoring algorithm.

Can you help me with the steps or link to any post which explains step by
step overriding(DefaultSimilarity class) default sorting algorithm?

Thanks in advance.
Gaurav


--
View this message in context: 
http://lucene.472066.n3.nabble.com/Change-default-scoring-formula-tp3012196p3012372.html
Sent from the Solr - User mailing list archive at Nabble.com.


Change default scoring formula

2011-06-01 Thread ngaurav2005
Hi All,

I need to change the default scoring formula of solr. How shall I hack the
code to do so?
also, is there any way to stop solr to do its default scoring and sorting?

Thanks,
Gaurav

--
View this message in context: 
http://lucene.472066.n3.nabble.com/Change-default-scoring-formula-tp3012196p3012196.html
Sent from the Solr - User mailing list archive at Nabble.com.


Sorting function with condition

2011-05-21 Thread ngaurav2005
Hi all,

I had to do sorting on search results based on some condition inside sort
function. Let me put forward with example:
Query: q=timestamp:123454321&sort=somefunction asc 

But this "Somefunction" has to have if condition inside it, like
If age =10, sum(value,x) 
Else sum(value,y)

Actually somefunction is sum of (value,x) or (value,y) based on age
condition. 

How to handle with this situation in solr search. I was trying to do with
solr math functions using sort parameter in query, but it donot supports if
condition. Is there any way to do this programatically(java)/solr plugin. I
am new to solr, so please help me complete set of details. 

Thanks in anticipation.

Gaurav


--
View this message in context: 
http://lucene.472066.n3.nabble.com/Sorting-function-with-condition-tp2970036p2970036.html
Sent from the Solr - User mailing list archive at Nabble.com.