mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-24 05:18:58 +00:00
Hotfixes (#134)
Co-authored-by: vlofgren <vlofgren@gmail.com> Co-authored-by: vlofgren <vlofgren@marginalia.nu> Co-authored-by: Viktor Lofgren <vlofgren@marginalia.nu> Reviewed-on: https://git.marginalia.nu/marginalia/marginalia.nu/pulls/134
This commit is contained in:
parent
6b44786649
commit
998ebc80a1
@ -14,6 +14,7 @@ import nu.marginalia.wmsa.podcasts.PodcastScraperMain;
|
|||||||
import nu.marginalia.wmsa.renderer.RendererMain;
|
import nu.marginalia.wmsa.renderer.RendererMain;
|
||||||
import nu.marginalia.wmsa.resource_store.ResourceStoreMain;
|
import nu.marginalia.wmsa.resource_store.ResourceStoreMain;
|
||||||
import nu.marginalia.wmsa.smhi.scraper.SmhiScraperMain;
|
import nu.marginalia.wmsa.smhi.scraper.SmhiScraperMain;
|
||||||
|
import org.apache.logging.log4j.core.lookup.MainMapLookup;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@ -77,6 +78,8 @@ public enum ServiceDescriptor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String... args) {
|
public static void main(String... args) {
|
||||||
|
MainMapLookup.setMainArguments(args);
|
||||||
|
|
||||||
Map<String, Command> functions = Stream.of(
|
Map<String, Command> functions = Stream.of(
|
||||||
new ListCommand(),
|
new ListCommand(),
|
||||||
new StartCommand(),
|
new StartCommand(),
|
||||||
|
@ -49,8 +49,6 @@ public class ForwardIndexConverter {
|
|||||||
|
|
||||||
logger.info("Converting {} {}",inputFile, journalReader.fileHeader);
|
logger.info("Converting {} {}",inputFile, journalReader.fileHeader);
|
||||||
|
|
||||||
final Path intermediateDocsFile = Files.createTempFile(tmpFileDir, "words-sorted", ".dat");
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
LongArray docsFileId = getDocIds(outputFileDocsId, journalReader);
|
LongArray docsFileId = getDocIds(outputFileDocsId, journalReader);
|
||||||
|
|
||||||
@ -74,15 +72,11 @@ public class ForwardIndexConverter {
|
|||||||
});
|
});
|
||||||
|
|
||||||
docFileData.force();
|
docFileData.force();
|
||||||
|
docsFileId.force();
|
||||||
|
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
logger.error("Failed to convert", ex);
|
logger.error("Failed to convert", ex);
|
||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
finally {
|
|
||||||
Files.deleteIfExists(intermediateDocsFile);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private LongArray getDocIds(Path outputFileDocs, SearchIndexJournalReader journalReader) throws IOException {
|
private LongArray getDocIds(Path outputFileDocs, SearchIndexJournalReader journalReader) throws IOException {
|
||||||
|
Loading…
Reference in New Issue
Block a user