Re: Conditional Field Search without affecting score.

2013-03-26 Thread Chris Hostetter

: document accordingly. This works good in most cases. but we had a case where
: we ran into issue. 
: 
: DocA // Common title and is same for all county so no additional titles.
:  title.0Fightertitle.0
: 
: DocB  
:  title.0The Ultimate Street Fightertitle.0  // Default 
:  title.1Ultimate Fightertitle.1 // For UK
: 
: 
: now querying for UK user q=(title.0:Fighter^50 OR title.1:Fighter^100)
: DocB shows 1st as it scores higher but user is expecting DocA

FYI: The crux of your problem is that when a document matches both title.0 
and title.X, you give it a score that is sum of the scores of hte sub 
queries, but when a document only matches title.0, you only give it the 
score from that sub-query *and* because of the coord factor, you penalize 
it for not having a match in the title.X field.

if you use the dismax/edismax qparser (or write your own QParser that uses 
builds DisjunctionMaxQuery objects) you can say i want the score of the 
document to be based on whichever sub-query scores the highest, and ignore 
hte other sub-queries) and there is no coord factor penalty.

Note however, that if the boosts you use between the title.0 and title.X 
field clauses are really disperate, then you may still run into problems 
One approach to overcoming hte bias against docs with only a general 
title, would be to change your indexing strategy so that actually cpy 
title.0 into all of the other title.X fields when there is no country 
specific title.  Another approach might be to index a special field for 
each doc indicating which countries it has a special title for, and then 
boosting documents where that field does *not* match on the users country.

(or as Erick mentioned: you can use the function query support to build up 
some really interesting conditional logic on what matches and what scores 
you give)


-Hoss


Re: Conditional Field Search without affecting score.

2013-02-18 Thread adityab
thanks Eric, 

is this what you are pointing me to ?

http://.../solr/select?q=if(exist(title.3),(title.3:xyz),(title.0:xyz))

I believe i should be able to use boost along with proximity too. 



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Conditional-Field-Search-without-affecting-score-tp4040657p4041188.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Conditional Field Search without affecting score.

2013-02-17 Thread Erick Erickson
Have you seen the new function queries in 4.x? In particular 'if' and
'exists' See: http://wiki.apache.org/solr/FunctionQuery#if

Best
Erick


On Fri, Feb 15, 2013 at 12:10 PM, adityab aditya_ba...@yahoo.com wrote:

 Hi,
 Trying to find a better approach for searching keywords.
 We have indexed about 100K documents indexed in Solr 3.5 and each doc has
 field title for different country
 Field title is dynamic defined as title.* about 20 countries .
 its not necessary that each document will have title for all 20 countries
 but every document will have title.0 which indicates as default. Our
 current search query is currently querying
 q=(title.0:xyz^50 OR title.3:xyz^100)
 where we used title.3 because user country id is 3 so boosting locale
 document accordingly. This works good in most cases. but we had a case
 where
 we ran into issue.

 DocA // Common title and is same for all county so no additional titles.
  title.0Fightertitle.0

 DocB
  title.0The Ultimate Street Fightertitle.0  // Default
  title.1Ultimate Fightertitle.1 // For UK


 now querying for UK user q=(title.0:Fighter^50 OR title.1:Fighter^100)
 DocB shows 1st as it scores higher but user is expecting DocA

 Is there any query function to check if the title.countryId exist then
 look into it else just look into title.0 only

 any other suggestion to avoid such issue would really help.
 We are also planning to move to Solr4.1 so anything with this new Solr
 version will also do.




 --
 View this message in context:
 http://lucene.472066.n3.nabble.com/Conditional-Field-Search-without-affecting-score-tp4040657.html
 Sent from the Solr - User mailing list archive at Nabble.com.



Conditional Field Search without affecting score.

2013-02-15 Thread adityab
Hi, 
Trying to find a better approach for searching keywords. 
We have indexed about 100K documents indexed in Solr 3.5 and each doc has
field title for different country
Field title is dynamic defined as title.* about 20 countries . 
its not necessary that each document will have title for all 20 countries
but every document will have title.0 which indicates as default. Our
current search query is currently querying 
q=(title.0:xyz^50 OR title.3:xyz^100)
where we used title.3 because user country id is 3 so boosting locale
document accordingly. This works good in most cases. but we had a case where
we ran into issue. 

DocA // Common title and is same for all county so no additional titles.
 title.0Fightertitle.0

DocB  
 title.0The Ultimate Street Fightertitle.0  // Default 
 title.1Ultimate Fightertitle.1 // For UK


now querying for UK user q=(title.0:Fighter^50 OR title.1:Fighter^100)
DocB shows 1st as it scores higher but user is expecting DocA

Is there any query function to check if the title.countryId exist then
look into it else just look into title.0 only 

any other suggestion to avoid such issue would really help. 
We are also planning to move to Solr4.1 so anything with this new Solr
version will also do.




--
View this message in context: 
http://lucene.472066.n3.nabble.com/Conditional-Field-Search-without-affecting-score-tp4040657.html
Sent from the Solr - User mailing list archive at Nabble.com.