mirror of https://github.com/apache/lucene.git
SOLR-9996: Unstored IntPointField returns Long type
This commit is contained in:
parent
f57e0177ff
commit
69055aa4a8
|
@ -74,6 +74,8 @@ Optimizations
|
|||
* SOLR-9584: Support Solr being proxied with another endpoint than default /solr, by using relative links
|
||||
in AdminUI javascripts (Yun Jie Zhou via janhoy)
|
||||
|
||||
* SOLR-9996: Unstored IntPointField returns Long type (Ishan Chattopadhyaya)
|
||||
|
||||
Other Changes
|
||||
----------------------
|
||||
* SOLR-8396: Add support for PointFields in Solr (Ishan Chattopadhyaya, Tomás Fernández Löbbe)
|
||||
|
|
|
@ -89,7 +89,7 @@ public class IntPointField extends PointField implements IntValueFieldType {
|
|||
public Object toObject(IndexableField f) {
|
||||
final Number val = f.numericValue();
|
||||
if (val != null) {
|
||||
return val;
|
||||
return val.intValue();
|
||||
} else {
|
||||
throw new AssertionError("Unexpected state. Field: '" + f + "'");
|
||||
}
|
||||
|
|
|
@ -785,6 +785,11 @@ public class TestPointFields extends SolrTestCaseJ4 {
|
|||
for (int i=0; i < values.length; i++) {
|
||||
assertU(adoc("id", String.valueOf(i), field, values[i]));
|
||||
}
|
||||
// Check using RTG
|
||||
for (int i = 0; i < values.length; i++) {
|
||||
assertQ(req("qt", "/get", "id", String.valueOf(i)),
|
||||
"//doc/" + type + "[@name='" + field + "'][.='" + values[i] + "']");
|
||||
}
|
||||
assertU(commit());
|
||||
String[] expected = new String[values.length + 1];
|
||||
expected[0] = "//*[@numFound='" + values.length + "']";
|
||||
|
@ -792,6 +797,12 @@ public class TestPointFields extends SolrTestCaseJ4 {
|
|||
expected[i] = "//result/doc[" + i + "]/" + type + "[@name='" + field + "'][.='" + values[i-1] + "']";
|
||||
}
|
||||
assertQ(req("q", "*:*", "fl", "id, " + field, "rows", String.valueOf(values.length)), expected);
|
||||
|
||||
// Check using RTG
|
||||
for (int i = 0; i < values.length; i++) {
|
||||
assertQ(req("qt", "/get", "id", String.valueOf(i)),
|
||||
"//doc/" + type + "[@name='" + field + "'][.='" + values[i] + "']");
|
||||
}
|
||||
}
|
||||
|
||||
private void doTestIntPointFieldRangeQuery(String fieldName, String type, boolean testLong) throws Exception {
|
||||
|
|
Loading…
Reference in New Issue