: 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" ..
1) SpanFirstQuery should work, it scores higher the closer the nested
query is to the start -- just use a really high limit,. if you are only
dealing with
il: u...@thetaphi.de
> -Original Message-
> From: shb [mailto:sharo...@gmail.com]
> Sent: Wednesday, February 25, 2009 3:56 PM
> To: java-dev@lucene.apache.org
> Subject: RE: sort lucene results
>
>
> i set the index field like this:
>
>
i set the index field like this:
Field nameField = null;
while(rs.next() == true)
{
String name = rs.getString("name");
nameField = new
Field("name",name.trim(),Field.Store.YES,Field.Index.TOKENIZED);
doc.add(nameField);
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.-Meie