lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: svn commit: r1576096 - in /lucene/dev/branches/lucene5487/lucene: core/src/java/org/apache/lucene/search/ core/src/test/org/apache/lucene/search/ facet/src/java/org/apache/lucene/facet/ facet/src/java/org/apache/lucene/facet/taxonomy/ grouping/src/jav
Date Mon, 10 Mar 2014 22:09:29 GMT
Hi Mike,

Would it not be better to have only one FakeScorer implementation in some pkg-private class.
This is too much code duplication for me!

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: mikemccand@apache.org [mailto:mikemccand@apache.org]
> Sent: Monday, March 10, 2014 10:42 PM
> To: commits@lucene.apache.org
> Subject: svn commit: r1576096 - in
> /lucene/dev/branches/lucene5487/lucene:
> core/src/java/org/apache/lucene/search/
> core/src/test/org/apache/lucene/search/
> facet/src/java/org/apache/lucene/facet/
> facet/src/java/org/apache/lucene/facet/taxonomy/ grouping/src/java...
> 
> Author: mikemccand
> Date: Mon Mar 10 21:41:44 2014
> New Revision: 1576096
> 
> URL: http://svn.apache.org/r1576096
> Log:
> LUCENE-5487: throw OUE from FakeScorer.getWeight
> 
> Modified:
> 
> lucene/dev/branches/lucene5487/lucene/core/src/java/org/apache/lucene/
> search/BooleanScorer.java
> 
> lucene/dev/branches/lucene5487/lucene/core/src/java/org/apache/lucene/
> search/IndexSearcher.java
> 
> lucene/dev/branches/lucene5487/lucene/core/src/test/org/apache/lucene/
> search/TestBooleanScorer.java
> 
> lucene/dev/branches/lucene5487/lucene/facet/src/java/org/apache/lucene
> /facet/DrillSidewaysScorer.java
> 
> lucene/dev/branches/lucene5487/lucene/facet/src/java/org/apache/lucene
> /facet/taxonomy/TaxonomyFacetSumValueSource.java
> 
> lucene/dev/branches/lucene5487/lucene/grouping/src/java/org/apache/luc
> ene/search/grouping/BlockGroupingCollector.java
> 
> lucene/dev/branches/lucene5487/lucene/join/src/java/org/apache/lucene/
> search/join/TermsIncludingScoreQuery.java
> 
> lucene/dev/branches/lucene5487/lucene/join/src/java/org/apache/lucene/
> search/join/ToParentBlockJoinCollector.java
> 
> Modified:
> lucene/dev/branches/lucene5487/lucene/core/src/java/org/apache/lucene/
> search/BooleanScorer.java
> URL:
> http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/lucene/cor
> e/src/java/org/apache/lucene/search/BooleanScorer.java?rev=1576096&r1=
> 1576095&r2=1576096&view=diff
> ==========================================================
> ====================
> ---
> lucene/dev/branches/lucene5487/lucene/core/src/java/org/apache/lucene/
> search/BooleanScorer.java (original)
> +++
> lucene/dev/branches/lucene5487/lucene/core/src/java/org/apache/lucen
> +++ e/search/BooleanScorer.java Mon Mar 10 21:41:44 2014
> @@ -153,6 +153,11 @@ final class BooleanScorer extends BulkSc
>      public long cost() {
>        throw new UnsupportedOperationException();
>      }
> +
> +    @Override
> +    public Weight getWeight() {
> +      throw new UnsupportedOperationException();
> +    }
>    }
> 
>    static final class Bucket {
> 
> Modified:
> lucene/dev/branches/lucene5487/lucene/core/src/java/org/apache/lucene/
> search/IndexSearcher.java
> URL:
> http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/lucene/cor
> e/src/java/org/apache/lucene/search/IndexSearcher.java?rev=1576096&r1=
> 1576095&r2=1576096&view=diff
> ==========================================================
> ====================
> ---
> lucene/dev/branches/lucene5487/lucene/core/src/java/org/apache/lucene/
> search/IndexSearcher.java (original)
> +++
> lucene/dev/branches/lucene5487/lucene/core/src/java/org/apache/lucen
> +++ e/search/IndexSearcher.java Mon Mar 10 21:41:44 2014
> @@ -805,6 +805,11 @@ public class IndexSearcher {
>        public long cost() {
>          return 1;
>        }
> +
> +      @Override
> +      public Weight getWeight() {
> +        throw new UnsupportedOperationException();
> +      }
>      }
> 
>      private final FakeScorer fakeScorer = new FakeScorer();
> 
> Modified:
> lucene/dev/branches/lucene5487/lucene/core/src/test/org/apache/lucene/
> search/TestBooleanScorer.java
> URL:
> http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/lucene/cor
> e/src/test/org/apache/lucene/search/TestBooleanScorer.java?rev=1576096
> &r1=1576095&r2=1576096&view=diff
> ==========================================================
> ====================
> ---
> lucene/dev/branches/lucene5487/lucene/core/src/test/org/apache/lucene/
> search/TestBooleanScorer.java (original)
> +++
> lucene/dev/branches/lucene5487/lucene/core/src/test/org/apache/lucen
> +++ e/search/TestBooleanScorer.java Mon Mar 10 21:41:44 2014
> @@ -240,6 +240,11 @@ public class TestBooleanScorer extends L
>      public long cost() {
>        throw new UnsupportedOperationException();
>      }
> +
> +    @Override
> +    public Weight getWeight() {
> +      throw new UnsupportedOperationException();
> +    }
>    }
> 
>    /** Throws UOE if Weight.scorer is called */
> 
> Modified:
> lucene/dev/branches/lucene5487/lucene/facet/src/java/org/apache/lucene
> /facet/DrillSidewaysScorer.java
> URL:
> http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/lucene/fac
> et/src/java/org/apache/lucene/facet/DrillSidewaysScorer.java?rev=1576096
> &r1=1576095&r2=1576096&view=diff
> ==========================================================
> ====================
> ---
> lucene/dev/branches/lucene5487/lucene/facet/src/java/org/apache/lucene
> /facet/DrillSidewaysScorer.java (original)
> +++
> lucene/dev/branches/lucene5487/lucene/facet/src/java/org/apache/luce
> +++ ne/facet/DrillSidewaysScorer.java Mon Mar 10 21:41:44 2014
> @@ -661,6 +661,11 @@ class DrillSidewaysScorer extends BulkSc
>      public Collection<ChildScorer> getChildren() {
>        return Collections.singletonList(new ChildScorer(baseScorer, "MUST"));
>      }
> +
> +    @Override
> +    public Weight getWeight() {
> +      throw new UnsupportedOperationException();
> +    }
>    }
> 
>    static class DocsAndCost implements Comparable<DocsAndCost> {
> 
> Modified:
> lucene/dev/branches/lucene5487/lucene/facet/src/java/org/apache/lucene
> /facet/taxonomy/TaxonomyFacetSumValueSource.java
> URL:
> http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/lucene/fac
> et/src/java/org/apache/lucene/facet/taxonomy/TaxonomyFacetSumValueS
> ource.java?rev=1576096&r1=1576095&r2=1576096&view=diff
> ==========================================================
> ====================
> ---
> lucene/dev/branches/lucene5487/lucene/facet/src/java/org/apache/lucene
> /facet/taxonomy/TaxonomyFacetSumValueSource.java (original)
> +++
> lucene/dev/branches/lucene5487/lucene/facet/src/java/org/apache/luce
> +++ ne/facet/taxonomy/TaxonomyFacetSumValueSource.java Mon Mar 10
> +++ 21:41:44 2014
> @@ -22,8 +22,8 @@ import java.util.HashMap;  import java.util.List;  import
> java.util.Map;
> 
> -import org.apache.lucene.facet.FacetsCollector;
>  import org.apache.lucene.facet.FacetsCollector.MatchingDocs;
> +import org.apache.lucene.facet.FacetsCollector;
>  import org.apache.lucene.facet.FacetsConfig;
>  import org.apache.lucene.index.AtomicReaderContext;
>  import org.apache.lucene.queries.function.FunctionValues;
> @@ -31,6 +31,7 @@ import org.apache.lucene.queries.functio  import
> org.apache.lucene.queries.function.docvalues.DoubleDocValues;
>  import org.apache.lucene.search.DocIdSetIterator;
>  import org.apache.lucene.search.Scorer;
> +import org.apache.lucene.search.Weight;
>  import org.apache.lucene.util.IntsRef;
> 
>  /** Aggregates sum of values from {@link @@ -70,6 +71,11 @@ public class
> TaxonomyFacetSumValueSource
>      @Override public int nextDoc() throws IOException { throw new
> UnsupportedOperationException(); }
>      @Override public int advance(int target) throws IOException { throw new
> UnsupportedOperationException(); }
>      @Override public long cost() { return 0; }
> +
> +    @Override
> +    public Weight getWeight() {
> +      throw new UnsupportedOperationException();
> +    }
>    }
> 
>    private final void sumValues(List<MatchingDocs> matchingDocs, boolean
> keepScores, ValueSource valueSource) throws IOException {
> 
> Modified:
> lucene/dev/branches/lucene5487/lucene/grouping/src/java/org/apache/luc
> ene/search/grouping/BlockGroupingCollector.java
> URL:
> http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/lucene/gro
> uping/src/java/org/apache/lucene/search/grouping/BlockGroupingCollector.
> java?rev=1576096&r1=1576095&r2=1576096&view=diff
> ==========================================================
> ====================
> ---
> lucene/dev/branches/lucene5487/lucene/grouping/src/java/org/apache/luc
> ene/search/grouping/BlockGroupingCollector.java (original)
> +++
> lucene/dev/branches/lucene5487/lucene/grouping/src/java/org/apache/l
> +++ ucene/search/grouping/BlockGroupingCollector.java Mon Mar 10
> +++ 21:41:44 2014
> @@ -90,7 +90,7 @@ public class BlockGroupingCollector exte
>      int doc;
> 
>      public FakeScorer() {
> -      super((Weight) null);
> +      super(null);
>      }
> 
>      @Override
> @@ -122,6 +122,11 @@ public class BlockGroupingCollector exte
>      public long cost() {
>        return 1;
>      }
> +
> +    @Override
> +    public Weight getWeight() {
> +      throw new UnsupportedOperationException();
> +    }
>    }
> 
>    private static final class OneGroup {
> 
> Modified:
> lucene/dev/branches/lucene5487/lucene/join/src/java/org/apache/lucene/
> search/join/TermsIncludingScoreQuery.java
> URL:
> http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/lucene/joi
> n/src/java/org/apache/lucene/search/join/TermsIncludingScoreQuery.java?
> rev=1576096&r1=1576095&r2=1576096&view=diff
> ==========================================================
> ====================
> ---
> lucene/dev/branches/lucene5487/lucene/join/src/java/org/apache/lucene/
> search/join/TermsIncludingScoreQuery.java (original)
> +++
> lucene/dev/branches/lucene5487/lucene/join/src/java/org/apache/lucen
> +++ e/search/join/TermsIncludingScoreQuery.java Mon Mar 10 21:41:44
> 2014
> @@ -242,6 +242,11 @@ class TermsIncludingScoreQuery extends Q
>      public long cost() {
>        throw new UnsupportedOperationException();
>      }
> +
> +    @Override
> +    public Weight getWeight() {
> +      throw new UnsupportedOperationException();
> +    }
>    }
> 
>    // This impl assumes that the 'join' values are used uniquely per doc per
> field. Used for one to many relations.
> 
> Modified:
> lucene/dev/branches/lucene5487/lucene/join/src/java/org/apache/lucene/
> search/join/ToParentBlockJoinCollector.java
> URL:
> http://svn.apache.org/viewvc/lucene/dev/branches/lucene5487/lucene/joi
> n/src/java/org/apache/lucene/search/join/ToParentBlockJoinCollector.java?
> rev=1576096&r1=1576095&r2=1576096&view=diff
> ==========================================================
> ====================
> ---
> lucene/dev/branches/lucene5487/lucene/join/src/java/org/apache/lucene/
> search/join/ToParentBlockJoinCollector.java (original)
> +++
> lucene/dev/branches/lucene5487/lucene/join/src/java/org/apache/lucen
> +++ e/search/join/ToParentBlockJoinCollector.java Mon Mar 10 21:41:44
> +++ 2014
> @@ -331,7 +331,7 @@ public class ToParentBlockJoinCollector
>      int doc;
> 
>      public FakeScorer() {
> -      super((Weight) null);
> +      super(null);
>      }
> 
>      @Override
> @@ -363,6 +363,11 @@ public class ToParentBlockJoinCollector
>      public long cost() {
>        return 1;
>      }
> +
> +    @Override
> +    public Weight getWeight() {
> +      throw new UnsupportedOperationException();
> +    }
>    }
> 
>    private OneGroup[] sortedGroups;



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


Mime
View raw message