I don't think that it is related with lucene version.
Please inspect the C# code below. "fragments1" has no highlight info, on the
other hand "fragments2" has one.
RAMDirectory dir = new RAMDirectory();
IndexWriter wr = new IndexWriter(dir, new WhitespaceAnalyzer(),
true);
Document doc = new Document();
doc.Add(new Field("f1", "aaa aab aac aad", Field.Store.YES,
Field.Index.ANALYZED,Field.TermVector.WITH_POSITIONS_OFFSETS));
wr.AddDocument(doc);
wr.Close();
IndexReader rdr = IndexReader.Open(dir, true);
QueryParser p = new QueryParser("f1", new WhitespaceAnalyzer());
Query q = p.Parse("aa*");
Lucene.Net.Search.Vectorhighlight.FastVectorHighlighter fvh =
new Lucene.Net.Search.Vectorhighlight.FastVectorHighlighter();
string[] fragments1 =
fvh.GetBestFragments(fvh.GetFieldQuery(q.Rewrite(rdr)), rdr, 0, "f1", 100,
2);
if (q is MultiTermQuery)
{
((MultiTermQuery)q).SetRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_QUERY_RE
WRITE);
}
string[] fragments2 =
fvh.GetBestFragments(fvh.GetFieldQuery(q.Rewrite(rdr)), rdr, 0, "f1", 100,
2);
DIGY
-----Original Message-----
From: halbtuerderschwarze [mailto:[email protected]]
Sent: Thursday, March 04, 2010 11:22 PM
To: [email protected]
Subject: RE: FastVectorHighlighter truncated queries
Not with Lucene 3.0.1.
Tomorrow I will try it with 2.9.2.
Arne
--
View this message in context:
http://old.nabble.com/FastVectorHighlighter-truncated-queries-tp27709797p277
86722.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]