Highlighter doesn't highlight wildcard queries after updating to 2.9.1/3.0.0

2009-12-30 Thread Mohsen Saboorian
After updating to 2.9.x or 3.0, highlighter doesn't work on wildcard queries like "abc*". I thought that it would be because of scoring, so I also set myIndexSearcher.setDefaultFieldSortScoring(true, true) before searching. I tested with both QueryScorer and QueryTermScorer. In my custom highligh

Re: Highlighter doesn't highlight wildcard queries after updating to 2.9.1/3.0.0

2009-12-30 Thread Mark Miller
Mohsen Saboorian wrote: > After updating to 2.9.x or 3.0, highlighter doesn't work on wildcard queries > like "abc*". I thought that it would be because of scoring, so I also set > myIndexSearcher.setDefaultFieldSortScoring(true, true) before searching. > I tested with both QueryScorer and QueryTer

Re: Highlighter doesn't highlight wildcard queries after updating to 2.9.1/3.0.0

2009-12-30 Thread Mohsen Saboorian
Yes I can (though I need some time, since I have my nested custom analyzers and filter). I'll try to write a test scenario to reproduce this issue. For now, can you tell me if these steps are correct for instantiating and using highlighter: IndexSearcher is = new IndexSearcher(indexReader); Quer

Re: Highlighter doesn't highlight wildcard queries after updating to 2.9.1/3.0.0

2010-01-10 Thread Mohsen Saboorian
The problem comes from this method: org.apache.lucene.search.highlight.WeightedSpanTermExtractor.extract(Query, Map) 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 extra

Re: Highlighter doesn't highlight wildcard queries after updating to 2.9.1/3.0.0

2010-01-10 Thread Mohsen Saboorian
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 Lucen

Re: Highlighter doesn't highlight wildcard queries after updating to 2.9.1/3.0.0

2010-01-11 Thread Mohsen Saboorian
changing MultiTermRewriteMethod fixed all previous incompatibility issue. After setting this: myQueryParser.setMultiTermRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE); highlighter get compatible with rewrite, query.rewrite().toString() works as before and scoring works fine for wildc