lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doz...@gmx.de
Subject Can't return Hits!
Date Thu, 01 Sep 2005 08:14:13 GMT
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: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message