lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: java.lang.NegativeArraySizeException on searching using Integer.MAX_VALUE for number of hits
Date Sun, 06 Dec 2009 09:53:19 GMT
OK, I opened https://issues.apache.org/jira/browse/LUCENE-2119

Mike

On Wed, Dec 2, 2009 at 8:34 AM, Paul Taylor <paul_t100@fastmail.fm> wrote:
> 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
>
>

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