2

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?

Rahul
  • 1,403
  • 4
  • 18
  • 31

3 Answers3

2

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

Mike R.
  • 558
  • 2
  • 4
  • ya pf2 pf3 will bring doc to top..but how will i know that what made this doc come on top..is it because of qf, pf, pf2, pf3? – Rahul Oct 02 '12 at 17:22
1

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

Rahul
  • 1,403
  • 4
  • 18
  • 31
0

mm (Minimum 'Should' Match) feature of edismax can be used here

http://wiki.apache.org/solr/ExtendedDisMax

Vishal
  • 31
  • 6