Skip to content

Commit

Permalink
Post-pend md5 to prebuilt indexes (#2412)
Browse files Browse the repository at this point in the history
  • Loading branch information
16BitNarwhal authored Mar 21, 2024
1 parent d48a40f commit 1dd9139
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/io/anserini/index/IndexInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
public enum IndexInfo {
CACM("cacm",
"Lucene index of the CACM corpus.",
"lucene-index.cacm.tar.gz",
"lucene-index.cacm.20221005.252b5e.tar.gz",
new String[] {
"https://github.com/castorini/anserini-data/raw/master/CACM/lucene-index.cacm.20221005.252b5e.tar.gz" },
"cfe14d543c6a27f4d742fb2d0099b8e0"),
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/io/anserini/util/PrebuiltIndexHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,12 @@ public String decompressIndex() throws Exception {
}

System.out.println("Index decompressed successfully!");

// postpend md5 to decompressed index
Path oldIndexPath = Paths.get(indexFolder);
indexFolder += "." + info.md5;
this.indexFolderPath = Paths.get(indexFolder);
Files.move(oldIndexPath, this.indexFolderPath);
return indexFolder;
}

Expand Down

0 comments on commit 1dd9139

Please sign in to comment.