views:

21

answers:

1

I am using Solr 1.3.This is the schema.xml of Solr 1.3. (http://pastebin.com/NwEy9Kz6). If i search for 'Hero' (e.g. +movieName:"Hero"), the Top most search document which contain the word "Hero", not the exact matching "Hero" document. e.g. Heroes, The Hero, Hero Hiralal, Heroes 2, Herold, Hero.

I want the exact match word appear on the top of the search result. Please suggest.

+1  A: 

You need to create a second field in your document that has not been tokenized. This can be accomplished using the string type from the default schema.

If you only want to return exact matches you can just search on this field. If you would like to return all matches, but return this one first you can search both fields. Matching both fields results in a boosting effect.

Here are some examples of field definitions:

field name="manufacturer" type="text_ws" indexed="true" stored="true"

field name="manufacturer_exact" type="string" indexed="true" stored="false"

topherd