OK, to answer my own question: I found from the following issue that if I do a query.rewrite(), highlighter doesn't work. https://issues.apache.org/jira/browse/LUCENE-1425
I did rewrite() in order to find all matched terms for example in a prefix query, but as this doesn't work anymore like Lucene 2.3, and returns nothings renderable, I stopped rewriting and to my surprise, highlighter worked with prefix, or other queries. It was also needed to add lucene-memory contrib library (which is referenced by WeightedSpanTermExtractor) to prevent exception (NCDFE). Mohsen Mohsen Saboorian wrote: > > The problem comes from this method: > org.apache.lucene.search.highlight.WeightedSpanTermExtractor.extract(Query, > Map<String, WeightedSpanTerm>) > > The query passed to this method is of type > org.apache.lucene.search.ConstantScoreQuery, but it matches non of > 'instanceof' checkings in this method, so no WeightedSpanTerm is > extracted. > > It this a bug? > > Thanks, > Mohsen > -- View this message in context: http://old.nabble.com/Highlighter-doesn%27t-highlight-wildcard-queries-after-updating-to-2.9.1-3.0.0-tp26969517p27106737.html Sent from the Lucene - Java Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org