public final class BlackLab extends Object
Modifier and Type | Method and Description |
---|---|
static void |
applyConfigToIndex(BlackLabIndex index)
Configure the index according to the blacklab configuration.
|
static BlackLabConfig |
config()
Get the BlackLab config.
|
static BlackLabIndexWriter |
create(File indexDir,
ConfigInputFormat config)
Create an empty index.
|
static BlackLabEngine |
createEngine() |
static BlackLabEngine |
createEngine(int searchThreads,
int maxThreadsPerSearch) |
static List<File> |
defaultConfigDirs()
Return a list of directories that should be searched for BlackLab-related
configuration files.
|
static BlackLabIndex |
fromIndexReader(org.apache.lucene.index.IndexReader reader) |
static BlackLabEngine |
implicitInstance()
Return the implicitly created instance of BlackLab.
|
static BlackLabIndex |
open(File dir) |
static BlackLabIndexWriter |
openForWriting(File indexDir,
boolean createNewIndex)
Open an index for writing ("index mode": adding/deleting documents).
|
static BlackLabIndexWriter |
openForWriting(File indexDir,
boolean createNewIndex,
ConfigInputFormat config)
Open an index for writing ("index mode": adding/deleting documents).
|
static BlackLabIndexWriter |
openForWriting(File indexDir,
boolean createNewIndex,
File indexTemplateFile)
Open an index for writing ("index mode": adding/deleting documents).
|
static void |
setConfig(BlackLabConfig config)
Set the BlackLab configuration to use.
|
static void |
setConfigFromFile()
Read blacklab.yaml and set the configuration from that.
|
public static BlackLabEngine createEngine(int searchThreads, int maxThreadsPerSearch)
public static BlackLabEngine createEngine()
public static BlackLabIndex open(File dir) throws ErrorOpeningIndex
ErrorOpeningIndex
public static BlackLabIndexWriter openForWriting(File indexDir, boolean createNewIndex) throws ErrorOpeningIndex
indexDir
- the index directorycreateNewIndex
- if true, create a new index even if one existed thereErrorOpeningIndex
- if the index could not be openedpublic static BlackLabIndexWriter openForWriting(File indexDir, boolean createNewIndex, File indexTemplateFile) throws ErrorOpeningIndex
indexDir
- the index directorycreateNewIndex
- if true, create a new index even if one existed thereindexTemplateFile
- JSON template to use for index structure / metadataErrorOpeningIndex
- if index couldn't be openedpublic static BlackLabIndexWriter openForWriting(File indexDir, boolean createNewIndex, ConfigInputFormat config) throws ErrorOpeningIndex
indexDir
- the index directorycreateNewIndex
- if true, create a new index even if one existed thereconfig
- input format config to use as template for index structure /
metadata (if creating new index)ErrorOpeningIndex
- if the index couldn't be openedpublic static BlackLabIndexWriter create(File indexDir, ConfigInputFormat config) throws ErrorOpeningIndex
indexDir
- where to create the indexconfig
- format configuration for this index; used to base the index
metadata onErrorOpeningIndex
- if the index couldn't be openedpublic static BlackLabEngine implicitInstance()
public static BlackLabIndex fromIndexReader(org.apache.lucene.index.IndexReader reader)
public static List<File> defaultConfigDirs()
FileUtil.findFile(List, String, List)
.public static BlackLabConfig config()
public static void setConfigFromFile()
public static void setConfig(BlackLabConfig config)
config
- configuration to usepublic static void applyConfigToIndex(BlackLabIndex index) throws IOException
index
- IOException
Copyright © 2020 Instituut voor Nederlandse Taal (INT). All rights reserved.