I'm using solr 3.5 for a type ahead search system. I want to rank
exact matches(lowercased) higher than non-exact matches.

For example, if i have two docs:
Doc One: title="New York"
Doc Two: title="New York City"

I would expect a query of "new york" to rank "New York" over "New York City"

It looks like I need to take into account the # of matches vs the
total # of tokens in a field. I'm not sure how to do this.

My debug query shows the two docs with the exact scores:
<lst name="debug">
<str name="rawquerystring">"new york"</str>
<str name="querystring">"new york"</str>
<str name="parsedquery">+DisjunctionMaxQuery((title:"new york"^50.0 |
textng:"new york"^40.0))</str>
<str name="parsedquery_toString">+(title:"new york"^50.0 | textng:"new
york"^40.0)</str>
<lst name="explain">
<str name="4f553cbc03643929d093d467">1.1890696 = (MATCH) max of:
1.1890696 = (MATCH) weight(title:"new york"^50.0 in 0), product of:
0.99999994 = queryWeight(title:"new york"^50.0), product of:      50.0
= boost      1.1890697 = idf(title: new=2 york=2)      0.01681987 =
queryNorm    1.1890697 = fieldWeight(title:"new york" in 0), product
of:      1.0 = tf(phraseFreq=1.0)      1.1890697 = idf(title: new=2
york=2)      1.0 = fieldNorm(field=title, doc=0)</str>
<str name="4f553cbc03643929d093d468">1.1890696 = (MATCH) max of:
1.1890696 = (MATCH) weight(title:"new york"^50.0 in 1), product of:
0.99999994 = queryWeight(title:"new york"^50.0), product of:      50.0
= boost      1.1890697 = idf(title: new=2 york=2)      0.01681987 =
queryNorm    1.1890697 = fieldWeight(title:"new york" in 1), product
of:      1.0 = tf(phraseFreq=1.0)      1.1890697 = idf(title: new=2
york=2)      1.0 = fieldNorm(field=title, doc=1)</str>
</lst>

I posted my solrconfig/schema here:
https://gist.github.com/1984052

-- 
Tommy Chheng

Reply via email to