lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: svn commit: r1025978 - /lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/MultiTermQuery.java
Date Thu, 21 Oct 2010 12:53:22 GMT
Thanks Uwe!

Mike

On Thu, Oct 21, 2010 at 8:51 AM,  <uschindler@apache.org> wrote:
> Author: uschindler
> Date: Thu Oct 21 12:51:06 2010
> New Revision: 1025978
>
> URL: http://svn.apache.org/viewvc?rev=1025978&view=rev
> Log:
> fix caching on Mike's last commit. Also remove counting at all.
>
> Modified:
>    lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/MultiTermQuery.java
>
> Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/MultiTermQuery.java
> URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/MultiTermQuery.java?rev=1025978&r1=1025977&r2=1025978&view=diff
> ==============================================================================
> --- lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/MultiTermQuery.java (original)
> +++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/MultiTermQuery.java Thu
Oct 21 12:51:06 2010
> @@ -247,10 +247,9 @@ public abstract class MultiTermQuery ext
>
>   private abstract static class BooleanQueryRewrite extends RewriteMethod {
>
> -    protected final int collectTerms(IndexReader reader, MultiTermQuery query, TermCollector
collector) throws IOException {
> +    protected final void collectTerms(IndexReader reader, MultiTermQuery query, TermCollector
collector) throws IOException {
>       final List<IndexReader> subReaders = new ArrayList<IndexReader>();
>       ReaderUtil.gatherSubReaders(subReaders, reader);
> -      int count = 0;
>       Comparator<BytesRef> lastTermComp = null;
>
>       for (IndexReader r : subReaders) {
> @@ -281,15 +280,11 @@ public abstract class MultiTermQuery ext
>         collector.setNextEnum(termsEnum);
>         BytesRef bytes;
>         while ((bytes = termsEnum.next()) != null) {
> -          if (collector.collect(bytes)) {
> -            termsEnum.cacheCurrentTerm();
> -            count++;
> -          } else {
> -            return count; // interrupt whole term collection, so also don't iterate
other subReaders
> -          }
> +          termsEnum.cacheCurrentTerm();
> +          if (!collector.collect(bytes))
> +            return; // interrupt whole term collection, so also don't iterate
other subReaders
>         }
>       }
> -      return count;
>     }
>
>     protected static abstract class TermCollector {
>
>
>

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


Mime
View raw message