You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by GitBox <gi...@apache.org> on 2021/08/03 13:55:58 UTC

[GitHub] [jackrabbit-oak] thomasmueller opened a new pull request #336: OAK-9522 Index cost estimation: prefer union query with path restriction

thomasmueller opened a new pull request #336:
URL: https://github.com/apache/jackrabbit-oak/pull/336


   


-- 
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: dev-unsubscribe@jackrabbit.apache.org

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



[GitHub] [jackrabbit-oak] thomasmueller commented on a change in pull request #336: OAK-9522 Index cost estimation: prefer union query with path restriction

Posted by GitBox <gi...@apache.org>.
thomasmueller commented on a change in pull request #336:
URL: https://github.com/apache/jackrabbit-oak/pull/336#discussion_r684099573



##########
File path: oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexPathRestrictionTest.java
##########
@@ -104,6 +105,53 @@ public void pathTranformationWithNoPathRestriction() throws Exception {
         validateResult(f, of("/", "/test", "/test/c"));
     }
 
+    @Test
+    public void entryCountWithNoPathRestriction() throws Exception {
+        IndexDefinitionBuilder idxBuilder =
+                new LuceneIndexDefinitionBuilder(rootBuilder.child(IndexConstants.INDEX_DEFINITIONS_NAME).
+                        child("fooIndex"))
+                        .noAsync().evaluatePathRestrictions();
+        idxBuilder.indexRule("nt:base").property("foo").propertyIndex();
+        idxBuilder.build();
+        commit();
+
+        NodeBuilder testRootBuilder = rootBuilder.child("test");
+        for(int i=0; i<100; i++) {
+            testRootBuilder.child("n" + i).setProperty("foo", "bar");
+        }
+        commit();
+
+        FilterImpl f;
+
+        // //*[foo = 'bar']
+        f = createFilter(root, NT_BASE);
+        f.restrictProperty("foo", Operator.EQUAL, PropertyValues.newString("bar"));
+        // equality check: we assume 5 different values

Review comment:
       +1




-- 
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: dev-unsubscribe@jackrabbit.apache.org

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



[GitHub] [jackrabbit-oak] thomasmueller merged pull request #336: OAK-9522 Index cost estimation: prefer union query with path restriction

Posted by GitBox <gi...@apache.org>.
thomasmueller merged pull request #336:
URL: https://github.com/apache/jackrabbit-oak/pull/336


   


-- 
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: dev-unsubscribe@jackrabbit.apache.org

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



[GitHub] [jackrabbit-oak] averma21 commented on a change in pull request #336: OAK-9522 Index cost estimation: prefer union query with path restriction

Posted by GitBox <gi...@apache.org>.
averma21 commented on a change in pull request #336:
URL: https://github.com/apache/jackrabbit-oak/pull/336#discussion_r683351322



##########
File path: oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexPathRestrictionTest.java
##########
@@ -104,6 +105,53 @@ public void pathTranformationWithNoPathRestriction() throws Exception {
         validateResult(f, of("/", "/test", "/test/c"));
     }
 
+    @Test
+    public void entryCountWithNoPathRestriction() throws Exception {
+        IndexDefinitionBuilder idxBuilder =
+                new LuceneIndexDefinitionBuilder(rootBuilder.child(IndexConstants.INDEX_DEFINITIONS_NAME).
+                        child("fooIndex"))
+                        .noAsync().evaluatePathRestrictions();
+        idxBuilder.indexRule("nt:base").property("foo").propertyIndex();
+        idxBuilder.build();
+        commit();
+
+        NodeBuilder testRootBuilder = rootBuilder.child("test");
+        for(int i=0; i<100; i++) {
+            testRootBuilder.child("n" + i).setProperty("foo", "bar");
+        }
+        commit();
+
+        FilterImpl f;
+
+        // //*[foo = 'bar']
+        f = createFilter(root, NT_BASE);
+        f.restrictProperty("foo", Operator.EQUAL, PropertyValues.newString("bar"));
+        // equality check: we assume 5 different values

Review comment:
       I guess this is referring to {{FulltextIndexPlanner#DEFAULT_PROPERTY_WEIGHT}}. I think it would be nice to use that constant here - both in comment and assert statement below, so that it is easier to understand and we don't need to change it, if the default weight changes.




-- 
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: dev-unsubscribe@jackrabbit.apache.org

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