lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject cvs commit: jakarta-lucene/src/java/org/apache/lucene/search DateFilter.java
Date Mon, 21 Jan 2002 17:12:12 GMT
cutting     02/01/21 09:12:12

  Modified:    src/java/org/apache/lucene/search DateFilter.java
  Log:
  Substantially improved the performance of DateFilter by adding the
  ability to reuse TermDocs objects.
  
  Revision  Changes    Path
  1.2       +2 -1      jakarta-lucene/src/java/org/apache/lucene/search/DateFilter.java
  
  Index: DateFilter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/search/DateFilter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DateFilter.java	18 Sep 2001 16:29:56 -0000	1.1
  +++ DateFilter.java	21 Jan 2002 17:12:12 -0000	1.2
  @@ -129,10 +129,11 @@
     final public BitSet bits(IndexReader reader) throws IOException {
       BitSet bits = new BitSet(reader.maxDoc());
       TermEnum enum = reader.terms(new Term(field, start));
  +    TermDocs termDocs = reader.termDocs();
       try {
         Term stop = new Term(field, end);
         while (enum.term().compareTo(stop) <= 0) {
  -	TermDocs termDocs = reader.termDocs(enum.term());
  +	termDocs.seek(enum.term());
   	try {
   	  while (termDocs.next())
   	    bits.set(termDocs.doc());
  
  
  

--
To unsubscribe, e-mail:   <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>


Mime
View raw message