solr dismax identify phrase match
Question
I am searching for "i want honda bike" on a text field using edismax query handler.
My intent is to find out docs having "honda bike" in it.
Now the results containing "honda", "bike" and "honda bike". Basically I am not interest in "honda" and "bike". I am actually interested in "honda bike".
Is there any way to identify if the phrase in field has matched the user query?
Solution 2
The problem was IDF was disturbing the score hence I could not fully rely on score to confidently say what has perfectly matched. So I disabled IDF calculation.
take a look at
http://lucene.472066.n3.nabble.com/Identify-exact-search-in-edismax-td4011859.html#a4011976
OTHER TIPS
I would investigate these parameters -- pf, pf2, and pf3.
pf -- phrase fields. This will let you boost the documents that have your q values in close proximity.
pf2 and pf3 -- chops the input into bigrams (or trigrams).
There are also slop settings to give some leeway in matching.
http://wiki.apache.org/solr/ExtendedDisMax#pf_.28Phrase_Fields.29
mm (Minimum 'Should' Match) feature of edismax can be used here