A Lucene SpanFirstQuery (with a boost) would do it, but you'd have to find a query parse that supports it and most don't.

You could also keep a copy of the title as a string field and then use a trailing wildcard to check if the title began with a term and boost it.

   title_s:Kabul*^2.0

-- Jack Krupansky

-----Original Message----- From: Jonty Rhods
Sent: Thursday, May 03, 2012 3:43 PM
To: solr-user@lucene apache org
Subject: Sorting result first which come first in sentance

Hi all,



I need suggetion:



I

Hi all,



I need suggetion:



I have many title like:



1 bomb blast in kabul

2 kabul bomb blast

3 3 people killed in serial bomb blast in kabul



I want 2nd result should come first while user search by "kabul".

Because kabul is on 1st postion in that sentance.  Similarly 1st result
should come on 2nd and 3rd should come last.



Please suggest me hot to implement this..



Regard

Jonty


Reply via email to