With a custom Tokenizer/Analyzer you could boost the words (tokens) during
indexing by their position, e.g. first word gets factor 100, second 99 and
so on. As sorting is by relevance, hits where the word is more at the
beginning gets higher ranking because of boost.

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: [email protected]

> -----Original Message-----
> From: shb [mailto:[email protected]]
> Sent: Wednesday, February 25, 2009 3:31 PM
> To: [email protected]
> Subject: sort lucene results
> 
> 
> hi i need help.
> 
> i need to search by word in sentences with lucene. for example by the word
> "bbb" i got the right results of all the sentences :
> 
> "text  ok ok ok bbb" , "text 2 bbb text " , "bbb  text 4...".
> 
> but i need the result by the word place in the sentence like this:
> 
> "bbb text 4...". , "text 2 bbb text " , "text 1 ok ok ok bbb" ..
> 
> waiting for ideas.. thanks..
> 
> 
> --
> View this message in context: http://www.nabble.com/sort-lucene-results-
> tp22203922p22203922.html
> Sent from the Lucene - Java Developer mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to