BlackLab icon indicating copy to clipboard operation
BlackLab copied to clipboard

If you specify an index format file that was already loaded, don't show an error, just use it

Open jan-niestadt opened this issue 4 years ago • 2 comments

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).

jan-niestadt avatar Jun 21 '21 12:06 jan-niestadt

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)

jan-niestadt avatar Jun 21 '21 12:06 jan-niestadt

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.

jan-niestadt avatar May 23 '22 09:05 jan-niestadt

Fixed on dev.

jan-niestadt avatar Apr 05 '24 08:04 jan-niestadt