fabriziofortino commented on code in PR #1002:
URL: https://github.com/apache/jackrabbit-oak/pull/1002#discussion_r1239745440


##########
oak-search/src/test/java/org/apache/jackrabbit/oak/plugins/index/PropertyIndexCommonTest.java:
##########
@@ -419,6 +419,28 @@ public void dateQueryWithEmptyValue() throws Exception {
         assertEventually(() -> assertQuery("select [jcr:path] from [nt:base] 
where [textField] = 'foo'", singletonList("/test/a")));
     }
 
+    @Test
+    public void inQueryWithUnparseableValue() throws Exception {
+        Tree idx = indexOptions.setIndex(
+                root,
+                "test1",
+                
indexOptions.createIndex(indexOptions.createIndexDefinitionBuilder(), false, 
"booleanField")
+        );
+        Tree booleanField = 
idx.getChild("indexRules").getChild("nt:base").getChild(PROP_NODE).getChild("booleanField");
+        booleanField.setProperty(FulltextIndexConstants.PROP_TYPE, 
PropertyType.TYPENAME_BOOLEAN);
+        root.commit();
+
+        Tree test = root.getTree("/").addChild("test");
+        test.addChild("a").setProperty("booleanField", true);

Review Comment:
   I wanted to do that but this query won't produce the same results in lucene 
and elastic. This is one of the cases where we cannot easily provide full 
compatibility. Lucene is not very strict with field types, while Elastic 
enforces the type declared in the mapping.
   Reaching full compatibility for these cases where the queries are somehow 
ambiguous would cost a lot in terms of implementation. This PR mainly 
guarantees that a query like this does not fail in lucene or elastic.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to