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

<defaultSearchField>text</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=letters&version=2.2&start=0&rows=10&indent=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% 3Aletters&version=2.2&start=0&rows=10&indent=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

Reply via email to