Boosting in version 1.2

2007-06-08 Thread Thierry Collogne

Hello,

Our documents contain three fields. title, keywords, content.
What we want is to give priority to the field keywords, than title and last
content.

So we did the following in our xml file that is to be indexed we put the
following

doc
 field name=keywords boost=3.0letters/field
 field name=title boost=2.0This is a test/field
 field name=content![CDATA[This is a test]]/field
/doc
doc
 field name=keywords boost=3.0foobar/field
 field name=title boost=2.0This is a test letters/field
 field name=content![CDATA[This is a test]]/field
/doc
doc
 field name=keywords boost=3.0foobar/field
 field name=title boost=2.0This is a test/field
 field name=content![CDATA[This is a test letters]]/field
/doc

In our schema.xml we have put

defaultSearchFieldtext/defaultSearchField

copyField source=titlesearch dest=text/
copyField source=keywords dest=text/
copyField source=content dest=text/

No when we do a search like this

http://localhost:8666/solr/select/?q=lettersversion=2.2start=0rows=10indent=on

We don't always get the document with letters in keywords on top. To get
this to work, we need to specify the 3 search fields like this

http://localhost:8666/solr/select/?q=content%3Aletters+OR+titlesearch%3Aletters+OR+keywords%3Alettersversion=2.2start=0rows=10indent=on

I was wondering if there is a way in Solr 1.2 to specify more than one
default search field, or is the above solution still the way to go?

Thank you,

Thierry


Re: Boosting in version 1.2

2007-06-08 Thread Mike Klaas

On 8-Jun-07, at 2:07 AM, Thierry Collogne wrote:


Hello,

Our documents contain three fields. title, keywords, content.
What we want is to give priority to the field keywords, than title  
and last

content




In our schema.xml we have put

defaultSearchFieldtext/defaultSearchField

copyField source=titlesearch dest=text/
copyField source=keywords dest=text/
copyField source=content dest=text/

No when we do a search like this

http://localhost:8666/solr/select/? 
q=lettersversion=2.2start=0rows=10indent=on


We don't always get the document with letters in keywords on top.  
To get

this to work, we need to specify the 3 search fields like this


I'm surprised that that finds anything--you've specified a  
defaultSearchField that doesn't exist in the documents you posted.


http://localhost:8666/solr/select/?q=content%3Aletters+OR 
+titlesearch%3Aletters+OR+keywords% 
3Alettersversion=2.2start=0rows=10indent=on


I was wondering if there is a way in Solr 1.2 to specify more than one
default search field, or is the above solution still the way to go?


This is precisely the situation that the dismax handler was designed  
for.  Plus, you don't have to fiddle around with document boosts.


try:

 qt=dismax q=letters qf=keywords^3.0 title^2.0 content

-Mike