Keep the IndexSearcher object you used to get the Hits open until you have finished with them...
Luc -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: donderdag 1 september 2005 10:14 To: java-user@lucene.apache.org Subject: Can't return Hits! Hi, i want to return the Hits!! For listing them out! But i get this Exception! Exception in thread "main" java.io.IOException: Das Handle ist ungültig at java.io.RandomAccessFile.seek(Native Method) at org.apache.lucene.store.FSInputStream.readInternal(FSDirectory.java:415) at org.apache.lucene.store.InputStream.refill(InputStream.java:158) at org.apache.lucene.store.InputStream.readByte(InputStream.java:43) at org.apache.lucene.store.InputStream.readBytes(InputStream.java:57) at org.apache.lucene.index.CompoundFileReader$CSInputStream.readInternal(CompoundFileReader.java:220) at org.apache.lucene.store.InputStream.refill(InputStream.java:158) at org.apache.lucene.store.InputStream.readByte(InputStream.java:43) at org.apache.lucene.store.InputStream.readInt(InputStream.java:73) at org.apache.lucene.store.InputStream.readLong(InputStream.java:96) at org.apache.lucene.index.FieldsReader.doc(FieldsReader.java:59) at org.apache.lucene.index.SegmentReader.document(SegmentReader.java:237) at org.apache.lucene.search.IndexSearcher.doc(IndexSearcher.java:74) at org.apache.lucene.search.Hits.doc(Hits.java:101) at search.Searcher.main(Searcher.java:76) What i do is: public void search() { .... hits = searcher.search(query); } public Hits getHits() { return hits; } public static void main (String [] args) { ... Hits h; h = s.getHits(); System.out.println(h.length()); //returns a number System.out.println(h.doc(0)!=null); //returns an exception } If i say h.doc(0) and the length is not 0, it throws an exception!! Why this could be??? Bye Derya -- GMX DSL = Maximale Leistung zum minimalen Preis! 2000 MB nur 2,99, Flatrate ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]