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.0">letters</field>
 <field name="title" boost="2.0">This is a test</field>
 <field name="content"><![CDATA[This is a test]]></field>
</doc>
<doc>
 <field name="keywords" boost="3.0">foobar</field>
 <field name="title" boost="2.0">This is a test letters</field>
 <field name="content"><![CDATA[This is a test]]></field>
</doc>
<doc>
 <field name="keywords" boost="3.0">foobar</field>
 <field name="title" boost="2.0">This is a test</field>
 <field name="content"><![CDATA[This is a test letters]]></field>
</doc>

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

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?

Thank you,

Thierry

Reply via email to