Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Upgrade to Lucene 9.9.0 #2290

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</developers>

<properties>
<lucene.version>9.8.0</lucene.version>
<lucene.version>9.9.0</lucene.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/io/anserini/index/IndexHnswDenseVectors.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
import org.apache.lucene.codecs.KnnVectorsFormat;
import org.apache.lucene.codecs.KnnVectorsReader;
import org.apache.lucene.codecs.KnnVectorsWriter;
import org.apache.lucene.codecs.lucene95.Lucene95Codec;
import org.apache.lucene.codecs.lucene95.Lucene95HnswVectorsFormat;
import org.apache.lucene.codecs.lucene99.Lucene99Codec;
import org.apache.lucene.codecs.lucene99.Lucene99HnswVectorsFormat;
import org.apache.lucene.index.ConcurrentMergeScheduler;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig;
Expand Down Expand Up @@ -280,11 +280,11 @@ public Counters run() throws IOException {

final Directory dir = FSDirectory.open(indexPath);
final IndexWriterConfig config = new IndexWriterConfig().setCodec(
new Lucene95Codec() {
new Lucene99Codec() {
@Override
public KnnVectorsFormat getKnnVectorsFormatForField(String field) {
return new OpenAiDelegatingKnnVectorsFormat(
new Lucene95HnswVectorsFormat(args.M, args.efC), 4096);
new Lucene99HnswVectorsFormat(args.M, args.efC), 4096);
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.miscellaneous.PerFieldAnalyzerWrapper;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.codecs.lucene95.Lucene95Codec;
import org.apache.lucene.codecs.lucene99.Lucene99Codec;
import org.apache.lucene.index.ConcurrentMergeScheduler;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig;
Expand Down Expand Up @@ -278,7 +278,7 @@ public Counters run() throws IOException {
Analyzer analyzer = new PerFieldAnalyzerWrapper(new StandardAnalyzer(), map);

final Directory dir = FSDirectory.open(indexPath);
final IndexWriterConfig config = new IndexWriterConfig(analyzer).setCodec(new Lucene95Codec());
final IndexWriterConfig config = new IndexWriterConfig(analyzer).setCodec(new Lucene99Codec());
config.setOpenMode(IndexWriterConfig.OpenMode.CREATE);
config.setRAMBufferSizeMB(args.memorybufferSize);
config.setUseCompoundFile(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@ public void test1() throws Exception {
"160885 Q0 44 2 0.861596 Anserini",
"160885 Q0 40 3 0.858651 Anserini",
"160885 Q0 48 4 0.858514 Anserini",
"160885 Q0 41 5 0.856264 Anserini",
"867490 Q0 10 1 0.850332 Anserini",
"160885 Q0 41 5 0.856265 Anserini",
"867490 Q0 10 1 0.850331 Anserini",
"867490 Q0 45 2 0.846281 Anserini",
"867490 Q0 44 3 0.845236 Anserini",
"867490 Q0 95 4 0.845013 Anserini",
Expand Down