Reputation: 1
I'm new in Solr. I've indexed 3 fields from MySql to solr. Id, first_name, last_name. I want to search in first_name and last_name. In schema.xml I wrote:
<fields>
<field name="id" type="string" indexed="true" stored="true"/>
<field name="first_name" type="text_general" indexed="true" stored="true"/>
<field name="last_name" type="text_general" indexed="true" stored="true"/>
</fields>
<uniqueKey>id</uniqueKey>
<defaultSearchField>first_name</defaultSearchField>
<solrQueryParser defaultOperator="OR"/>
What I have to write here for searching first in first_name and after in last_name. Where I have to give priorities for fields? Please, help me.
Upvotes: 0
Views: 75
Reputation: 11
You will have to define this on the query. I recomend you to use a requestHandler for this:
<requestHandler name="bcn_jug_en" class="solr.SearchHandler" enable="true">
<lst name="defaults">
<str name="defType">edismax</str>
<str name="qf">first_name^10 last_name^5</str>
<str name="mm">100%</str>
</lst>
http://searchhub.org/2010/05/23/whats-a-dismax/
Upvotes: 1