BlackLab
BlackLab copied to clipboard
If you specify an index format file that was already loaded, don't show an error, just use it
The situation: you have a format file (.blf.yaml) in a location that BlackLab scans (e.g. the current directory, or $HOME/.blacklab/formats). You then call IndexTool with the path to this format file as the format parameter:
java -cp "..." nl.inl.blacklab.tools.IndexTool create index input ./my-format.blf.yaml
This results in an error: "A config format with this name already exists."
Desired behaviour: BlackLab recognizes that this file was already loaded and doesn't try to load it again, but just uses it (like the user intended).
For now, the workaround is:
java -cp "..." nl.inl.blacklab.tools.IndexTool create index input my-format
(but the commandline specified above should obviously do the same thing)
In a similar situation: if BlackLab finds an external format file with the same name as an already-loaded (probably built-in) format file, it should probably replace the already-loaded one. Otherwise there's no way to override the builtin formats.
So e.g. instead of this message:
Skipping config format /vol1/etc/blacklab/formats/cmdi.blf.yaml; a format with this name already exists.
We'd probably prefer to see:
Loaded config format /vol1/etc/blacklab/formats/cmdi.blf.yaml, overriding previous cmdi format.
Fixed on dev.