0

I am getting a weird behavior with Solr search results.
I have a lot of documents indexed with a title field.
When I am doing a search over title field solr is not giving higher scores to exact match.

e.g. if my query is "China"
I am getting top documents with titles:
"China House of China Cove"
"National Art Museum of China"

This is weird as there is a document with title "China" and hence that should be the best match for query. Does anyone know what could be wrong here ?

snow_leopard
  • 1,466
  • 2
  • 20
  • 36
  • http://stackoverflow.com/questions/21775702/exact-word-match-solr/21791826?noredirect=1#21791826 Visit this Question hopefully you will get the answer :) – sohan Feb 25 '14 at 10:23

1 Answers1

0

Second to @sohan for the pointer. I'd agree it makes better sense to boost the exact match as in your example. And I hope this might be easier to work around, by indexing the title field again for exact match.

 <field name="title" type="text" indexed="true" stored="true" />
 <field name="titleExact" type="textExact" indexed="true" stored="true" />
 <copyField source="title" dest="titleExact"/>

Above example was taken from this article, which also provides a nice writeup to solve the problem.

leoh
  • 10,378
  • 7
  • 28
  • 39