[ 
https://issues.apache.org/jira/browse/SLING-12457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17891999#comment-17891999
 ] 

Robert Munteanu commented on SLING-12457:
-----------------------------------------

[~olli] - I thought you were asking about the OSGi configuration property name, 
but I guess you meant something else. The changes look good to me, I did some 
testing in the Sling Starter and all ITs pass once I add the configuration.

One thing I thing needs to be changed is the usage of HashSet to store property 
names ; I vaguely recall some problems with property names written in 
unpredictable order causing full reindexing. At any rate I don't think it hurts.

{code}
diff --git 
a/src/main/java/org/apache/sling/jcr/oak/server/internal/index/LuceneIndexRepositoryInitializer.java
 
b/src/main/java/org/apache/sling/jcr/oak/server/internal/index/LuceneIndexRepositoryInitializer.java
index ae6648f..07099d3 100644
--- 
a/src/main/java/org/apache/sling/jcr/oak/server/internal/index/LuceneIndexRepositoryInitializer.java
+++ 
b/src/main/java/org/apache/sling/jcr/oak/server/internal/index/LuceneIndexRepositoryInitializer.java
@@ -19,7 +19,7 @@
 package org.apache.sling.jcr.oak.server.internal.index;
 
 import java.util.Arrays;
-import java.util.HashSet;
+import java.util.LinkedHashSet;
 
 import org.apache.jackrabbit.oak.plugins.index.lucene.util.LuceneIndexHelper;
 import org.apache.jackrabbit.oak.spi.lifecycle.RepositoryInitializer;
@@ -67,8 +67,8 @@ public class LuceneIndexRepositoryInitializer implements 
RepositoryInitializer {
                 LuceneIndexHelper.newLuceneIndexDefinition(
                     index,
                     configuration.name(),
-                    new 
HashSet<>(Arrays.asList(configuration.includePropertyTypes())),
-                    new 
HashSet<>(Arrays.asList(configuration.excludePropertyNames())),
+                    new 
LinkedHashSet<>(Arrays.asList(configuration.includePropertyTypes())),
+                    new 
LinkedHashSet<>(Arrays.asList(configuration.excludePropertyNames())),
                     "async"
                 );
             }
{code}

I can push it directly if you prefer.

> Make creation of Lucene index definition configurable
> -----------------------------------------------------
>
>                 Key: SLING-12457
>                 URL: https://issues.apache.org/jira/browse/SLING-12457
>             Project: Sling
>          Issue Type: New Feature
>          Components: JCR, Oak
>            Reporter: Oliver Lietz
>            Assignee: Robert Munteanu
>            Priority: Minor
>              Labels: Sling-13-Release-Notes
>             Fix For: JCR Oak Server 1.4.4
>
>
> The Lucene index definition is created by {{{}OakSlingRepositoryManager{}}}, 
> but it should only be created when Lucene is used for indexing. In addition 
> it would be useful to have it configurable. See SLING-5796 and SLING-12452 
> for background.
> [https://jackrabbit.apache.org/oak/docs/query/lucene.html]
> WIP: 
> https://github.com/apache/sling-org-apache-sling-jcr-oak-server/tree/feature/SLING-12457



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to