You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by th...@apache.org on 2022/03/31 13:42:16 UTC

[jackrabbit-oak] branch OAK-9743-b created (now 1cc7bbb)

This is an automated email from the ASF dual-hosted git repository.

thomasm pushed a change to branch OAK-9743-b
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git.


      at 1cc7bbb  OAK-9743 oak-run indexing doesn't support facets

This branch includes the following new commits:

     new 1cc7bbb  OAK-9743 oak-run indexing doesn't support facets

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[jackrabbit-oak] 01/01: OAK-9743 oak-run indexing doesn't support facets

Posted by th...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

thomasm pushed a commit to branch OAK-9743-b
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git

commit 1cc7bbb715359beb9d22d9b5150b33f3e65a31a2
Author: Thomas Mueller <th...@apache.org>
AuthorDate: Thu Mar 31 15:41:59 2022 +0200

    OAK-9743 oak-run indexing doesn't support facets
---
 .../oak/index/indexer/document/LuceneIndexer.java    | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/LuceneIndexer.java b/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/LuceneIndexer.java
index b9cf76f..4f85fb1 100644
--- a/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/LuceneIndexer.java
+++ b/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/LuceneIndexer.java
@@ -26,6 +26,7 @@ import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.plugins.document.NodeDocument;
 import org.apache.jackrabbit.oak.plugins.index.lucene.LuceneDocumentMaker;
 import org.apache.jackrabbit.oak.plugins.index.lucene.util.FacetHelper;
+import org.apache.jackrabbit.oak.plugins.index.lucene.util.FacetsConfigProvider;
 import org.apache.jackrabbit.oak.plugins.index.lucene.writer.LuceneIndexWriter;
 import org.apache.jackrabbit.oak.plugins.index.progress.IndexingProgressReporter;
 import org.apache.jackrabbit.oak.plugins.index.search.IndexDefinition;
@@ -33,13 +34,15 @@ import org.apache.jackrabbit.oak.plugins.index.search.spi.binary.FulltextBinaryT
 import org.apache.jackrabbit.oak.spi.filter.PathFilter;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.lucene.document.Document;
+import org.apache.lucene.facet.FacetsConfig;
 
-public class LuceneIndexer implements NodeStateIndexer {
+public class LuceneIndexer implements NodeStateIndexer, FacetsConfigProvider {
     private final IndexDefinition definition;
     private final FulltextBinaryTextExtractor binaryTextExtractor;
     private final NodeBuilder definitionBuilder;
     private final LuceneIndexWriter indexWriter;
     private final IndexingProgressReporter progressReporter;
+    private FacetsConfig facetsConfig;
 
     public LuceneIndexer(IndexDefinition definition, LuceneIndexWriter indexWriter,
                          NodeBuilder builder, FulltextBinaryTextExtractor binaryTextExtractor,
@@ -111,11 +114,22 @@ public class LuceneIndexer implements NodeStateIndexer {
     private LuceneDocumentMaker newDocumentMaker(IndexDefinition.IndexingRule indexingRule, String path) {
         return new LuceneDocumentMaker(
                 binaryTextExtractor,
-                () -> FacetHelper.getFacetsConfig(definitionBuilder), //TODO FacetsConfig handling
-                null,   //TODO augmentorFactory
+                // we re-use the facet config
+                this,
+                // augmentorFactory is not supported (it is deprecated)
+                null,
                 definition,
                 indexingRule,
                 path
         );
     }
+
+    @Override
+    public FacetsConfig getFacetsConfig() {
+        if (facetsConfig == null){
+            facetsConfig = FacetHelper.getFacetsConfig(definitionBuilder);
+        }
+        return facetsConfig;
+    }
+
 }