Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class BenchmarkConfiguration {
public String hnswIndexDirPath;
public boolean loadVectorsInMemory;
public boolean skipIndexing;
public boolean forceMerge;

// Lucene HNSW parameters
public int hnswMaxConn; // 16 default (max 512)
Expand Down Expand Up @@ -79,7 +80,8 @@ public String prettyString() {
if (hnswIndexDirPath != null) sb.append("HNSW index directory path is: ").append(hnswIndexDirPath).append('\n');
sb.append("Load vectors in memory before indexing: ").append(loadVectorsInMemory).append('\n');
sb.append("Skip indexing (and use existing index for search): ").append(skipIndexing).append('\n');

sb.append("Do force merge while indexing documents: ").append(forceMerge).append('\n');

sb.append("------- algo parameters ------\n");
if (isLucene()) {
sb.append("hnswMaxConn: ").append(hnswMaxConn).append('\n');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,11 @@ private static void indexDocuments(IndexWriter writer, BenchmarkConfiguration co
pool.shutdown();
pool.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS);

if (config.forceMerge) {
log.info("Force merge is enabled.");
writer.forceMerge(1);
}

// log.info("Calling forceMerge(1).");
// writer.forceMerge(1);
log.info("Calling commit.");
Expand Down