lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Taylor <paul_t...@fastmail.fm>
Subject java.lang.NegativeArraySizeException on searching using Integer.MAX_VALUE for number of hits
Date Wed, 02 Dec 2009 13:34:19 GMT
Hi, just upgraded my code to Lucene 3.0 and on one simple search I get 
the following stacktrace when I pass Integer.MAX_VALUE to the 
Searcher.search(Query query,int n) method, if I change the value to 1000 
it works okay.


java.lang.NegativeArraySizeException
    at 
org.apache.lucene.util.PriorityQueue.initialize(PriorityQueue.java:90)
    at org.apache.lucene.search.HitQueue.<init>(HitQueue.java:67)
    at 
org.apache.lucene.search.TopScoreDocCollector.<init>(TopScoreDocCollector.java:117)
    at 
org.apache.lucene.search.TopScoreDocCollector.<init>(TopScoreDocCollector.java:37)
    at 
org.apache.lucene.search.TopScoreDocCollector$InOrderTopScoreDocCollector.<init>(TopScoreDocCollector.java:42)
    at 
org.apache.lucene.search.TopScoreDocCollector$InOrderTopScoreDocCollector.<init>(TopScoreDocCollector.java:40)
    at 
org.apache.lucene.search.TopScoreDocCollector.create(TopScoreDocCollector.java:104)
    at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:167)
    at org.apache.lucene.search.Searcher.search(Searcher.java:98)
    at org.apache.lucene.search.Searcher.search(Searcher.java:108)

Now I know I should specify a max hits value, but I really want to 
return all matches , and regardless it shouldn't throw this exception, 
and in other search code which also has specifies Integer.MAX_VALUE the 
exception is not occurring.


thanks Paul



---------------------------------------------------------------------
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