> If you are trying to use the highlighter package's SpanScorer class, there > may be a problem with it clashing (by name) with the > org.apache.lucene.search.spans.SpanScorer class: > > >>> import lucene > >>> lucene.initVM(lucene.CLASSPATH) > >>> lucene.SpanScorer.class_ > <Class: class org.apache.lucene.search.spans.SpanScorer>
I noticed that in the lucene-java-2.4.1 svn release that was downloaded when I built pylucene, there is no highlight folder anymore: http://svn.apache.org/repos/asf/lucene/java/tags/lucene_2_4_1/src/java/org/apache/lucene/search/ >From what I can tell though (From the build headers), pylucene thinks SpanScorer is in spans and highlighter > > > But without a specific example of what you're trying to do, it's mostly > just guesswork here. > > Could you please include a piece of code that reproduces the problem ? > Thanks ! > for i in range(0, self.hits.length()): text = self.hits.doc(i).get(self.FIELD_NAME) tokenStream = self.analyzer.tokenStream(self.FIELD_NAME, StringReader(text)) ctokenStream = CachingTokenFilter(tokenStream) highlighter = Highlighter(formatter, SpanScorer(self.query, self.FIELD_NAME, ctokenStream)) result = highlighter.getBestFragments(tokenStream, text, maxNumFragmentsRequired, "...") print "\t", result print "Found: ", It's the test_Highlighter.py code but I've changed it to try to test the SpanScorer class. Thanks, Max