You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2023/03/13 14:44:14 UTC

[couchdb] branch import-nouveau updated (82c5b9c78 -> 32b94377e)

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

rnewson pushed a change to branch import-nouveau
in repository https://gitbox.apache.org/repos/asf/couchdb.git


    omit 82c5b9c78 move application config to base project to tighten type safety
     new 48ac91e3f move application config to base project to tighten type safety
     new 32b94377e index testing framework

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (82c5b9c78)
            \
             N -- N -- N   refs/heads/import-nouveau (32b94377e)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 2 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.


Summary of changes:
 java/nouveau/base/pom.xml                          | 14 ++++++++
 .../couchdb/nouveau/core/BaseIndexTest.java}       | 18 ++++++++--
 java/nouveau/lucene4/pom.xml                       | 10 ++++++
 .../couchdb/nouveau/lucene4/core/Lucene4Index.java |  2 +-
 ...LuceneBundle => io.dropwizard.ConfiguredBundle} |  0
 .../nouveau/lucene4/core/Lucene4IndexTest.java     | 41 +++++++++++++++++++++
 java/nouveau/lucene9/pom.xml                       | 10 ++++++
 ...LuceneBundle => io.dropwizard.ConfiguredBundle} |  0
 .../nouveau/lucene9/core/Lucene9IndexTest.java     | 42 ++++++++++++++++++++++
 .../nouveau/NouveauApplicationConfiguration.java   |  0
 10 files changed, 133 insertions(+), 4 deletions(-)
 copy java/nouveau/base/src/{main/java/org/apache/couchdb/nouveau/core/IndexLoader.java => test/java/org/apache/couchdb/nouveau/core/BaseIndexTest.java} (58%)
 copy java/nouveau/lucene4/src/main/resources/META-INF/services/{org.apache.couchdb.nouveau.LuceneBundle => io.dropwizard.ConfiguredBundle} (100%)
 create mode 100644 java/nouveau/lucene4/src/test/java/org/apache/couchdb/nouveau/lucene4/core/Lucene4IndexTest.java
 copy java/nouveau/lucene9/src/main/resources/META-INF/services/{org.apache.couchdb.nouveau.LuceneBundle => io.dropwizard.ConfiguredBundle} (100%)
 create mode 100644 java/nouveau/lucene9/src/test/java/org/apache/couchdb/nouveau/lucene9/core/Lucene9IndexTest.java
 copy java/nouveau/{base => server}/src/main/java/org/apache/couchdb/nouveau/NouveauApplicationConfiguration.java (100%)


[couchdb] 01/02: move application config to base project to tighten type safety

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

rnewson pushed a commit to branch import-nouveau
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 48ac91e3f0c29c330d010e215b0e0eec6ef498b8
Author: Robert Newson <rn...@apache.org>
AuthorDate: Mon Mar 13 14:04:20 2023 +0000

    move application config to base project to tighten type safety
---
 .../org/apache/couchdb/nouveau/LuceneBundle.java   |  2 +-
 .../nouveau/NouveauApplicationConfiguration.java   | 86 ++++++++++++++++++++++
 .../couchdb/nouveau/lucene4/Lucene4Bundle.java     |  6 +-
 .../org.apache.couchdb.nouveau.LuceneBundle        | 16 ++++
 .../couchdb/nouveau/lucene9/Lucene9Bundle.java     |  6 +-
 .../org.apache.couchdb.nouveau.LuceneBundle        | 16 ++++
 .../apache/couchdb/nouveau/NouveauApplication.java | 11 +--
 7 files changed, 129 insertions(+), 14 deletions(-)

diff --git a/java/nouveau/base/src/main/java/org/apache/couchdb/nouveau/LuceneBundle.java b/java/nouveau/base/src/main/java/org/apache/couchdb/nouveau/LuceneBundle.java
index d309b0312..5eecd5973 100644
--- a/java/nouveau/base/src/main/java/org/apache/couchdb/nouveau/LuceneBundle.java
+++ b/java/nouveau/base/src/main/java/org/apache/couchdb/nouveau/LuceneBundle.java
@@ -17,7 +17,7 @@ import org.apache.couchdb.nouveau.core.IndexManager;
 
 import io.dropwizard.ConfiguredBundle;
 
-public class LuceneBundle<T> implements ConfiguredBundle<T> {
+public class LuceneBundle implements ConfiguredBundle<NouveauApplicationConfiguration> {
 
     protected IndexManager indexManager;
 
diff --git a/java/nouveau/base/src/main/java/org/apache/couchdb/nouveau/NouveauApplicationConfiguration.java b/java/nouveau/base/src/main/java/org/apache/couchdb/nouveau/NouveauApplicationConfiguration.java
new file mode 100644
index 000000000..6d90086ac
--- /dev/null
+++ b/java/nouveau/base/src/main/java/org/apache/couchdb/nouveau/NouveauApplicationConfiguration.java
@@ -0,0 +1,86 @@
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.couchdb.nouveau;
+
+import java.nio.file.Path;
+
+import javax.validation.constraints.Min;
+import javax.validation.constraints.NotNull;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import io.dropwizard.Configuration;
+
+public class NouveauApplicationConfiguration extends Configuration {
+
+    @Min(10)
+    private int maxIndexesOpen = 10;
+
+    @Min(10)
+    private int commitIntervalSeconds = 10;
+
+    @Min(30)
+    private int idleSeconds = 30;
+
+    @Min(-1)
+    private int lockCount = -1;
+
+    @NotNull
+    private Path rootDir = null;
+
+    @JsonProperty
+    public void setMaxIndexesOpen(int maxIndexesOpen) {
+        this.maxIndexesOpen = maxIndexesOpen;
+    }
+
+    public int getMaxIndexesOpen() {
+        return maxIndexesOpen;
+    }
+
+    @JsonProperty
+    public void setCommitIntervalSeconds(int commitIntervalSeconds) {
+        this.commitIntervalSeconds = commitIntervalSeconds;
+    }
+
+    public int getCommitIntervalSeconds() {
+        return commitIntervalSeconds;
+    }
+
+    @JsonProperty
+    public void setIdleSeconds(int idleSeconds) {
+        this.idleSeconds = idleSeconds;
+    }
+
+    public int getIdleSeconds() {
+        return idleSeconds;
+    }
+
+    public int getLockCount() {
+        return lockCount;
+    }
+
+    public void setLockCount(int lockCount) {
+        this.lockCount = lockCount;
+    }
+
+    @JsonProperty
+    public void setRootDir(Path rootDir) {
+        this.rootDir = rootDir;
+    }
+
+    public Path getRootDir() {
+        return rootDir;
+    }
+
+}
diff --git a/java/nouveau/lucene4/src/main/java/org/apache/couchdb/nouveau/lucene4/Lucene4Bundle.java b/java/nouveau/lucene4/src/main/java/org/apache/couchdb/nouveau/lucene4/Lucene4Bundle.java
index 93a0a564c..228f12d26 100644
--- a/java/nouveau/lucene4/src/main/java/org/apache/couchdb/nouveau/lucene4/Lucene4Bundle.java
+++ b/java/nouveau/lucene4/src/main/java/org/apache/couchdb/nouveau/lucene4/Lucene4Bundle.java
@@ -16,19 +16,19 @@ package org.apache.couchdb.nouveau.lucene4;
 import java.util.concurrent.ExecutorService;
 
 import org.apache.couchdb.nouveau.LuceneBundle;
+import org.apache.couchdb.nouveau.NouveauApplicationConfiguration;
 import org.apache.couchdb.nouveau.lucene4.core.Lucene4Module;
 import org.apache.couchdb.nouveau.lucene4.core.ParallelSearcherFactory;
 import org.apache.couchdb.nouveau.lucene4.resources.AnalyzeResource;
 import org.apache.couchdb.nouveau.lucene4.resources.IndexResource;
 import org.apache.lucene.search.SearcherFactory;
 
-import io.dropwizard.Configuration;
 import io.dropwizard.setup.Environment;
 
-public final class Lucene4Bundle extends LuceneBundle<Configuration> {
+public final class Lucene4Bundle extends LuceneBundle {
 
     @Override
-    public void run(final Configuration configuration, final Environment environment) throws Exception {
+    public void run(final NouveauApplicationConfiguration configuration, final Environment environment) throws Exception {
 
         // Serialization classes
         environment.getObjectMapper().registerModule(new Lucene4Module());
diff --git a/java/nouveau/lucene4/src/main/resources/META-INF/services/org.apache.couchdb.nouveau.LuceneBundle b/java/nouveau/lucene4/src/main/resources/META-INF/services/org.apache.couchdb.nouveau.LuceneBundle
new file mode 100644
index 000000000..8fe744dd9
--- /dev/null
+++ b/java/nouveau/lucene4/src/main/resources/META-INF/services/org.apache.couchdb.nouveau.LuceneBundle
@@ -0,0 +1,16 @@
+#  Licensed to the Apache Software Foundation (ASF) under one or more
+#  contributor license agreements.  See the NOTICE file distributed with
+#  this work for additional information regarding copyright ownership.
+#  The ASF licenses this file to You under the Apache License, Version 2.0
+#  (the "License"); you may not use this file except in compliance with
+#  the License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+org.apache.couchdb.nouveau.lucene4.Lucene4Bundle
diff --git a/java/nouveau/lucene9/src/main/java/org/apache/couchdb/nouveau/lucene9/Lucene9Bundle.java b/java/nouveau/lucene9/src/main/java/org/apache/couchdb/nouveau/lucene9/Lucene9Bundle.java
index 669f6ccbb..ee5c299e4 100644
--- a/java/nouveau/lucene9/src/main/java/org/apache/couchdb/nouveau/lucene9/Lucene9Bundle.java
+++ b/java/nouveau/lucene9/src/main/java/org/apache/couchdb/nouveau/lucene9/Lucene9Bundle.java
@@ -16,19 +16,19 @@ package org.apache.couchdb.nouveau.lucene9;
 import java.util.concurrent.ExecutorService;
 
 import org.apache.couchdb.nouveau.LuceneBundle;
+import org.apache.couchdb.nouveau.NouveauApplicationConfiguration;
 import org.apache.couchdb.nouveau.lucene9.core.Lucene9Module;
 import org.apache.couchdb.nouveau.lucene9.core.ParallelSearcherFactory;
 import org.apache.couchdb.nouveau.lucene9.resources.AnalyzeResource;
 import org.apache.couchdb.nouveau.lucene9.resources.IndexResource;
 import org.apache.lucene.search.SearcherFactory;
 
-import io.dropwizard.Configuration;
 import io.dropwizard.setup.Environment;
 
-public final class Lucene9Bundle extends LuceneBundle<Configuration> {
+public final class Lucene9Bundle extends LuceneBundle {
 
     @Override
-    public void run(final Configuration configuration, final Environment environment) throws Exception {
+    public void run(final NouveauApplicationConfiguration configuration, final Environment environment) throws Exception {
 
         // Serialization classes
         environment.getObjectMapper().registerModule(new Lucene9Module());
diff --git a/java/nouveau/lucene9/src/main/resources/META-INF/services/org.apache.couchdb.nouveau.LuceneBundle b/java/nouveau/lucene9/src/main/resources/META-INF/services/org.apache.couchdb.nouveau.LuceneBundle
new file mode 100644
index 000000000..64ad96f64
--- /dev/null
+++ b/java/nouveau/lucene9/src/main/resources/META-INF/services/org.apache.couchdb.nouveau.LuceneBundle
@@ -0,0 +1,16 @@
+#  Licensed to the Apache Software Foundation (ASF) under one or more
+#  contributor license agreements.  See the NOTICE file distributed with
+#  this work for additional information regarding copyright ownership.
+#  The ASF licenses this file to You under the Apache License, Version 2.0
+#  (the "License"); you may not use this file except in compliance with
+#  the License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+org.apache.couchdb.nouveau.lucene9.Lucene9Bundle
diff --git a/java/nouveau/server/src/main/java/org/apache/couchdb/nouveau/NouveauApplication.java b/java/nouveau/server/src/main/java/org/apache/couchdb/nouveau/NouveauApplication.java
index 7c5de8fbc..eba48ccd6 100644
--- a/java/nouveau/server/src/main/java/org/apache/couchdb/nouveau/NouveauApplication.java
+++ b/java/nouveau/server/src/main/java/org/apache/couchdb/nouveau/NouveauApplication.java
@@ -22,7 +22,6 @@ import org.apache.couchdb.nouveau.core.IndexManager;
 import org.apache.couchdb.nouveau.core.UpdatesOutOfOrderExceptionMapper;
 
 import io.dropwizard.Application;
-import io.dropwizard.ConfiguredBundle;
 import io.dropwizard.setup.Bootstrap;
 import io.dropwizard.setup.Environment;
 
@@ -49,13 +48,11 @@ public class NouveauApplication extends Application<NouveauApplicationConfigurat
                 try {
                     ClassLoader classLoader = URLClassLoader
                             .newInstance(new URL[] { new URL(System.getProperty(name)) });
-                    final ServiceLoader<ConfiguredBundle> bundleLoader = ServiceLoader.load(ConfiguredBundle.class,
+                    final ServiceLoader<LuceneBundle> bundleLoader = ServiceLoader.load(LuceneBundle.class,
                             classLoader);
-                    for (final ConfiguredBundle<NouveauApplicationConfiguration> bundle : bundleLoader) {
-                        if (bundle instanceof LuceneBundle) {
-                            ((LuceneBundle)bundle).setIndexManager(indexManager);
-                            bootstrap.addBundle(bundle);
-                        }
+                    for (final LuceneBundle bundle : bundleLoader) {
+                        bundle.setIndexManager(indexManager);
+                        bootstrap.addBundle(bundle);
                     }
                 } catch (final MalformedURLException e) {
                     throw new Error(e);


[couchdb] 02/02: index testing framework

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

rnewson pushed a commit to branch import-nouveau
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 32b94377e01f720a4ddecb30ad552dab8d455a91
Author: Robert Newson <rn...@apache.org>
AuthorDate: Mon Mar 13 14:43:13 2023 +0000

    index testing framework
---
 java/nouveau/base/pom.xml                          | 14 ++++++++
 .../apache/couchdb/nouveau/core/BaseIndexTest.java | 38 ++++++++++++++++++++
 java/nouveau/lucene4/pom.xml                       | 10 ++++++
 .../couchdb/nouveau/lucene4/core/Lucene4Index.java |  2 +-
 .../nouveau/lucene4/core/Lucene4IndexTest.java     | 41 +++++++++++++++++++++
 java/nouveau/lucene9/pom.xml                       | 10 ++++++
 .../nouveau/lucene9/core/Lucene9IndexTest.java     | 42 ++++++++++++++++++++++
 7 files changed, 156 insertions(+), 1 deletion(-)

diff --git a/java/nouveau/base/pom.xml b/java/nouveau/base/pom.xml
index d64e59a66..d14e49275 100644
--- a/java/nouveau/base/pom.xml
+++ b/java/nouveau/base/pom.xml
@@ -57,6 +57,20 @@
 
   <build>
     <defaultGoal>install</defaultGoal>
+    <plugins>
+     <plugin>
+       <groupId>org.apache.maven.plugins</groupId>
+       <artifactId>maven-jar-plugin</artifactId>
+       <version>3.0.2</version>
+       <executions>
+         <execution>
+           <goals>
+             <goal>test-jar</goal>
+           </goals>
+         </execution>
+       </executions>
+     </plugin>
+    </plugins>
   </build>
 
 </project>
diff --git a/java/nouveau/base/src/test/java/org/apache/couchdb/nouveau/core/BaseIndexTest.java b/java/nouveau/base/src/test/java/org/apache/couchdb/nouveau/core/BaseIndexTest.java
new file mode 100644
index 000000000..6d4120bc5
--- /dev/null
+++ b/java/nouveau/base/src/test/java/org/apache/couchdb/nouveau/core/BaseIndexTest.java
@@ -0,0 +1,38 @@
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.couchdb.nouveau.core;
+
+import java.io.IOException;
+import java.nio.file.Path;
+
+import org.apache.couchdb.nouveau.api.IndexDefinition;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
+
+public abstract class BaseIndexTest<T> {
+
+    @TempDir
+    static Path path;
+
+    protected abstract IndexLoader<T> indexLoader();
+
+    @Test
+    public void testOpenClose() throws IOException {
+        final IndexDefinition indexDefinition = new IndexDefinition();
+        indexDefinition.setDefaultAnalyzer("standard");
+        final Index<?> index = indexLoader().apply(path, indexDefinition);
+        index.close();
+    }
+
+}
diff --git a/java/nouveau/lucene4/pom.xml b/java/nouveau/lucene4/pom.xml
index 96da79323..c04bc541e 100644
--- a/java/nouveau/lucene4/pom.xml
+++ b/java/nouveau/lucene4/pom.xml
@@ -27,6 +27,16 @@
       <version>${project.version}</version>
     </dependency>
 
+      <!-- Base tests -->
+    <dependency>
+      <groupId>org.apache.couchdb.nouveau</groupId>
+      <artifactId>base</artifactId>
+      <version>${project.version}</version>
+      <classifier>tests</classifier>
+      <type>test-jar</type>
+      <scope>test</scope>
+    </dependency>
+
     <!-- Dropwizard -->
     <dependency>
       <groupId>io.dropwizard</groupId>
diff --git a/java/nouveau/lucene4/src/main/java/org/apache/couchdb/nouveau/lucene4/core/Lucene4Index.java b/java/nouveau/lucene4/src/main/java/org/apache/couchdb/nouveau/lucene4/core/Lucene4Index.java
index 01918fbb8..2f9ea6715 100644
--- a/java/nouveau/lucene4/src/main/java/org/apache/couchdb/nouveau/lucene4/core/Lucene4Index.java
+++ b/java/nouveau/lucene4/src/main/java/org/apache/couchdb/nouveau/lucene4/core/Lucene4Index.java
@@ -37,8 +37,8 @@ import org.apache.couchdb.nouveau.api.SearchResults;
 import org.apache.couchdb.nouveau.core.Index;
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.document.Document;
-import org.apache.lucene.document.StringField;
 import org.apache.lucene.document.Field.Store;
+import org.apache.lucene.document.StringField;
 import org.apache.lucene.facet.params.FacetSearchParams;
 import org.apache.lucene.facet.range.RangeAccumulator;
 import org.apache.lucene.facet.range.RangeFacetRequest;
diff --git a/java/nouveau/lucene4/src/test/java/org/apache/couchdb/nouveau/lucene4/core/Lucene4IndexTest.java b/java/nouveau/lucene4/src/test/java/org/apache/couchdb/nouveau/lucene4/core/Lucene4IndexTest.java
new file mode 100644
index 000000000..ee3c4ab34
--- /dev/null
+++ b/java/nouveau/lucene4/src/test/java/org/apache/couchdb/nouveau/lucene4/core/Lucene4IndexTest.java
@@ -0,0 +1,41 @@
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.couchdb.nouveau.lucene4.core;
+
+import org.apache.couchdb.nouveau.core.BaseIndexTest;
+import org.apache.couchdb.nouveau.core.IndexLoader;
+import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.index.IndexWriterConfig;
+import org.apache.lucene.index.IndexableField;
+import org.apache.lucene.search.SearcherManager;
+import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.FSDirectory;
+
+public class Lucene4IndexTest extends BaseIndexTest<IndexableField> {
+
+    @Override
+    protected IndexLoader<IndexableField> indexLoader() {
+        return (path, indexDefinition) -> {
+            final Analyzer analyzer = Lucene4AnalyzerFactory.fromDefinition(indexDefinition);
+            final Directory dir = FSDirectory.open(path.toFile());
+            final IndexWriterConfig config = new IndexWriterConfig(Utils.LUCENE_VERSION, analyzer);
+            config.setUseCompoundFile(false);
+            final IndexWriter writer = new IndexWriter(dir, config);
+            final SearcherManager searcherManager = new SearcherManager(writer, true, null);
+            return new Lucene4Index(analyzer, writer, 0L, searcherManager);
+        };
+    }
+
+}
diff --git a/java/nouveau/lucene9/pom.xml b/java/nouveau/lucene9/pom.xml
index b7a60e4c6..9047633aa 100644
--- a/java/nouveau/lucene9/pom.xml
+++ b/java/nouveau/lucene9/pom.xml
@@ -27,6 +27,16 @@
       <version>${project.version}</version>
     </dependency>
 
+    <!-- Base tests -->
+    <dependency>
+      <groupId>org.apache.couchdb.nouveau</groupId>
+      <artifactId>base</artifactId>
+      <version>${project.version}</version>
+      <classifier>tests</classifier>
+      <type>test-jar</type>
+      <scope>test</scope>
+    </dependency>
+
     <!-- Dropwizard -->
     <dependency>
       <groupId>io.dropwizard</groupId>
diff --git a/java/nouveau/lucene9/src/test/java/org/apache/couchdb/nouveau/lucene9/core/Lucene9IndexTest.java b/java/nouveau/lucene9/src/test/java/org/apache/couchdb/nouveau/lucene9/core/Lucene9IndexTest.java
new file mode 100644
index 000000000..1bc1db42c
--- /dev/null
+++ b/java/nouveau/lucene9/src/test/java/org/apache/couchdb/nouveau/lucene9/core/Lucene9IndexTest.java
@@ -0,0 +1,42 @@
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.couchdb.nouveau.lucene9.core;
+
+import org.apache.couchdb.nouveau.core.BaseIndexTest;
+import org.apache.couchdb.nouveau.core.IndexLoader;
+import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.index.IndexWriterConfig;
+import org.apache.lucene.index.IndexableField;
+import org.apache.lucene.misc.store.DirectIODirectory;
+import org.apache.lucene.search.SearcherManager;
+import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.FSDirectory;
+
+public class Lucene9IndexTest extends BaseIndexTest<IndexableField> {
+
+    @Override
+    protected IndexLoader<IndexableField> indexLoader() {
+        return (path, indexDefinition) -> {
+            final Analyzer analyzer = Lucene9AnalyzerFactory.fromDefinition(indexDefinition);
+            final Directory dir = new DirectIODirectory(FSDirectory.open(path));
+            final IndexWriterConfig config = new IndexWriterConfig(analyzer);
+            config.setUseCompoundFile(false);
+            final IndexWriter writer = new IndexWriter(dir, config);
+            final SearcherManager searcherManager = new SearcherManager(writer, null);
+            return new Lucene9Index(analyzer, writer, 0L, searcherManager);
+        };
+    }
+
+}