lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mary meriem <>
Subject please help
Date Sat, 25 May 2013 20:33:01 GMT
there is my code for getting in position for all term index and I'm stuck on this problem!!!!
anyone has an idea about this error??ar = (AtomicReader)readre;    System.out.print(ar); 
boolean withOffsets = false;  Fields fields = MultiFields.getFields(readre);  Term t= new
Term("contents");                DocsAndPositionsEnum td = ar.termPositionsEnum(ar.getLiveDocs(),
t.field(), t.bytes(), withOffsets);        int freq = td.freq();        for (int i = 0; i
< freq; i++) {            int pos= td.nextPosition();                System.out.println(String.valueOf(pos));

Exception in thread "main" java.lang.ClassCastException: org.apache.lucene.index.StandardDirectoryReader
cannot be cast to org.apache.lucene.index.AtomicReader	at Searcher.searchIndex(
at Searcher.main(
PS: i work with lucene 4.0.0 et sorry for my bad english :) 		 	   		  
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message