jpountz commented on code in PR #12109:
URL: https://github.com/apache/lucene/pull/12109#discussion_r1085101798


##########
lucene/memory/src/test/org/apache/lucene/index/memory/TestMemoryIndex.java:
##########
@@ -793,4 +793,42 @@ private static boolean arrayBinaryContains(BytesRef[] 
array, BytesRef value) {
     }
     return false;
   }
+
+  public void testIntegerNumericDocValue() throws IOException {
+    // MemoryIndex used to fail when doc values are enabled and numericValue() 
returns an Integer
+    // such as with IntField.
+    FieldType ft = new FieldType();
+    ft.setDocValuesType(DocValuesType.NUMERIC);
+    ft.freeze();
+    Field field =
+        new Field("field", ft) {
+          {
+            fieldsData = 35;
+          }
+        };
+
+    FieldType multiFt = new FieldType();
+    multiFt.setDocValuesType(DocValuesType.SORTED_NUMERIC);
+    multiFt.freeze();
+    Field multiField =
+        new Field("multi_field", multiFt) {
+          {
+            fieldsData = 35;
+          }
+        };

Review Comment:
   I added a custom field so that I could make sure the numericValue() is 
actually an Integer in case IntField changes at some point in the future. I'll 
add IntField explicitly too.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to