You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by tf...@apache.org on 2016/10/11 20:55:02 UTC
lucene-solr:jira/solr-8396: Added nocommit to storedToIndexed and
test for 'useDocValuesAsSorted'
Repository: lucene-solr
Updated Branches:
refs/heads/jira/solr-8396 ec9d2ed02 -> 6d39d66bc
Added nocommit to storedToIndexed and test for 'useDocValuesAsSorted'
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/6d39d66b
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/6d39d66b
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/6d39d66b
Branch: refs/heads/jira/solr-8396
Commit: 6d39d66bcf507a71e2b55547d31a2d3b0fe7b7b9
Parents: ec9d2ed
Author: Tom�s Fern�ndez L�bbe <tf...@a9.com>
Authored: Tue Oct 11 13:54:49 2016 -0700
Committer: Tom�s Fern�ndez L�bbe <tf...@a9.com>
Committed: Tue Oct 11 13:54:49 2016 -0700
----------------------------------------------------------------------
solr/core/src/java/org/apache/solr/schema/PointField.java | 4 +++-
solr/core/src/test/org/apache/solr/TestPointFields.java | 10 ++++++++++
2 files changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d39d66b/solr/core/src/java/org/apache/solr/schema/PointField.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/schema/PointField.java b/solr/core/src/java/org/apache/solr/schema/PointField.java
index 7d4e125..5e70159 100644
--- a/solr/core/src/java/org/apache/solr/schema/PointField.java
+++ b/solr/core/src/java/org/apache/solr/schema/PointField.java
@@ -179,7 +179,9 @@ public abstract class PointField extends PrimitiveFieldType {
@Override
public String storedToIndexed(IndexableField f) {
- return storedToIndexedByteRef(f).utf8ToString();
+ //nocommit: Is this OK? "utf8ToString" can sometimes fail
+// return storedToIndexedByteRef(f).utf8ToString();
+ throw new UnsupportedOperationException("Review this method implementation");
}
@Override
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d39d66b/solr/core/src/test/org/apache/solr/TestPointFields.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/TestPointFields.java b/solr/core/src/test/org/apache/solr/TestPointFields.java
index 42041ec..7b65288 100644
--- a/solr/core/src/test/org/apache/solr/TestPointFields.java
+++ b/solr/core/src/test/org/apache/solr/TestPointFields.java
@@ -26,6 +26,7 @@ import org.apache.solr.common.SolrException;
import org.apache.solr.schema.DoublePointField;
import org.apache.solr.schema.IntPointField;
import org.apache.solr.schema.PointField;
+import org.apache.solr.schema.SchemaField;
import org.junit.After;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -85,9 +86,15 @@ public class TestPointFields extends SolrTestCaseJ4 {
@Test
public void testIntPointFieldReturn() throws Exception {
testPointFieldReturn("number_p_i", "int", new String[]{"0", "1", "2", "3", "43", "52", "60", "74", "80", "99"});
+ clearIndex();
+ assertU(commit());
+ testPointFieldReturn("number_p_i_dv_ns", "int", new String[]{"0", "1", "2", "3", "43", "52", "60", "74", "80", "99"});
}
private void testPointFieldReturn(String field, String type, String[] values) throws Exception {
+ SchemaField sf = h.getCore().getLatestSchema().getField(field);
+ assert sf.stored() || (sf.hasDocValues() && sf.useDocValuesAsStored()):
+ "Unexpected field definition for " + field;
for (int i=0; i < values.length; i++) {
assertU(adoc("id", String.valueOf(i), field, values[i]));
}
@@ -722,6 +729,9 @@ public class TestPointFields extends SolrTestCaseJ4 {
testPointFieldReturn("number_p_d", "double", new String[]{"0.0", "1.2", "2.5", "3.02", "0.43", "5.2", "6.01", "74.0", "80.0", "9.9"});
clearIndex();
assertU(commit());
+ testPointFieldReturn("number_p_d_dv_ns", "double", new String[]{"0.0", "1.2", "2.5", "3.02", "0.43", "5.2", "6.01", "74.0", "80.0", "9.9"});
+ clearIndex();
+ assertU(commit());
String[] arr = new String[atLeast(10)];
for (int i = 0; i < arr.length; i++) {
double rand = random().nextDouble() * 10;