You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by is...@apache.org on 2017/03/12 00:18:15 UTC

[06/50] [abbrv] lucene-solr:jira/solr-6736: SOLR-10155: For numeric types facet.contains= and facet.prefix= are now rejected. (Gus Heck, Christine Poerschke)

SOLR-10155: For numeric types facet.contains= and facet.prefix= are now rejected.
(Gus Heck, Christine Poerschke)


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/43474312
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/43474312
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/43474312

Branch: refs/heads/jira/solr-6736
Commit: 43474312eb2b66df4102bd653b9546e7eff47363
Parents: da113fd
Author: Christine Poerschke <cp...@apache.org>
Authored: Fri Mar 3 12:03:41 2017 +0000
Committer: Christine Poerschke <cp...@apache.org>
Committed: Fri Mar 3 12:03:41 2017 +0000

----------------------------------------------------------------------
 solr/CHANGES.txt                                          |  2 ++
 .../src/java/org/apache/solr/request/SimpleFacets.java    | 10 ++++------
 2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/43474312/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 09912ee..fa4d33b 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -271,6 +271,8 @@ Other Changes
 
 * SOLR-10219: re-enable HDFS tests under JDK9 (hossman, Uwe Schindler)
 
+* SOLR-10155: For numeric types facet.contains= and facet.prefix= are now rejected.
+  (Gus Heck, Christine Poerschke)
 
 ==================  6.4.2 ==================
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/43474312/solr/core/src/java/org/apache/solr/request/SimpleFacets.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/request/SimpleFacets.java b/solr/core/src/java/org/apache/solr/request/SimpleFacets.java
index 4190958..5370dd9 100644
--- a/solr/core/src/java/org/apache/solr/request/SimpleFacets.java
+++ b/solr/core/src/java/org/apache/solr/request/SimpleFacets.java
@@ -484,15 +484,13 @@ public class SimpleFacets {
         case FCS:
           assert ft.isPointField() || !multiToken;
           if (ft.isPointField() || (ft.getNumberType() != null && !sf.multiValued())) {
-            // force numeric faceting
-            if (prefix != null && !prefix.isEmpty()) {
+            if (prefix != null) {
               throw new SolrException(ErrorCode.BAD_REQUEST, FacetParams.FACET_PREFIX + " is not supported on numeric types");
             }
             if (termFilter != null) {
-              final boolean supportedOperation = (termFilter instanceof SubstringBytesRefFilter) && ((SubstringBytesRefFilter) termFilter).substring().isEmpty();
-              if (!supportedOperation) {
-                throw new SolrException(ErrorCode.BAD_REQUEST, FacetParams.FACET_CONTAINS + " is not supported on numeric types");
-              }
+              throw new SolrException(ErrorCode.BAD_REQUEST, "BytesRef term filters ("
+                      + FacetParams.FACET_CONTAINS + ", "
+                      + FacetParams.FACET_EXCLUDETERMS + ") are not supported on numeric types");
             }
 //            We should do this, but mincount=0 is currently the default
 //            if (ft.isPointField() && mincount <= 0) {