lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From starz10de <>
Subject highlighter by using term offsets
Date Tue, 22 Nov 2011 13:35:03 GMT

 I'm writing a highlighter by using term offsets as follows:

IndexReader reader = indexPath ); 
TermPositionVector tpv = (TermPositionVector)reader.getTermFreqVector( 

When I run the searcher, I face this error in    

            TermPositionVector tpv =

Exception in thread "main" java.lang.NullPointerException
	at servlet.SearchFiles.doPagingSearch(
	at servlet.SearchFiles.SearchFiles(
	at servlet.test.main(
in the index , I stored the "contents" field as follows:

doc.add( new Field( "contents", TextFilesContent, Field.Store.YES,
Field.Index.ANALYZED,Field.TermVector.WITH_OFFSETS ) ); 

any hints?


View this message in context:
Sent from the Lucene - Java Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message