lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cory Albright <albri...@mt.sri.com>
Subject Re: too many hits - OutOfMemoryError
Date Wed, 28 May 2003 14:56:23 GMT
Thanks for the info, but unfortunately it still is getting an OutOfMemoryError,
Here's my code:

--------------------------------------------------
final BitSet bits = new BitSet();
HitCollector hc = new HitCollector() {
      public void collect(int doc, float score){
          System.out.println("collect");
          if (score > THRESHOLD) {
              bits.set(doc);
          }
      }
};
mSearcher.search(query, hc);
System.out.println("          results ("+bits.cardinality()+"):\n");
-----------------------------------------------------

When I search with a low-hit query, "collect" is printed many times.
When I search with a query I know will hit most of the 1.8 million records, 
the "collect" print
does not even print, it eats up the 700+MB I allocated and then throws an 
OutOfMemoryError.  Did
I do something wrong?

Thanks for you help,

Cory









At 09:43 PM 5/27/2003 +0200, you wrote:
> > Hits hits = searcher.search(myQuery);
>
>BitSet results = new BitSet();
>
>searcher.search(myQuery, new HitCollector()
>{
>   public void collect(int doc, float score)
>   {
>     if (score > THRESHOLD)
>       results.set(doc);
>   }
>});
>
>--
>Eric Jain
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: lucene-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message