As we discussed incidentally in other
thread (link to Kovid's reply), I suggested it would be nice to have the ability to export the FTS search. BTW, I don't mean exporting the title results related to some FTS query, but the actual search, including the
results snippets.
I had never used Calibre CLI, but the recent addition of FTS to calibredb has been quite useful for that purpose, so I gave it a try.
Using the commands below, I was able to generate the attached files, which contain the results snippets:
Code:
calibredb fts_search --include-snippets --output-format=text NEAR("biphasic" "sleep",30) > fts-export.txt
calibredb fts_search --include-snippets --output-format=json NEAR("biphasic" "sleep",30) > fts-export.json
Files generated contain special characters that I had cleaned up by using Notepad++ and replacing them as following:
Although using the CLI requires some practice for average users, the exported search was useful to me, even having to do that cleaning/beautifying. And the fact that one needs to close any Calibre instance before using calibredb is a little bothersome...
So I present some questions:
- if there's a better way to have the FTS search neatly exported, perhaps through some advanced batch scripting?
- is there some way to call calibredb on a read-only fashion, so that Calibre GUI instance can be kept open?
- would it be possible, in the future, to obtain the exported search
in the form of a catalogue, as BR suggested (but including the results snippets)? Or maybe some other form that could generate a file that can be "read like a book"... something like that.