3

The manual says that you can search a book, here. However, I am not sure if this is about its content. I have not managed to find a way to search the content in OSX's Calibre in Yosemite 10.10.3.

GUI in Advanced Search:

enter image description here

where I get no matches although I should get . Books are PDF, CHM and ebook formats.

How can you search contents of book in Calibre?

Léo Léopold Hertz 준영
  • 5,686
  • 12
  • 68
  • 115

4 Answers4

3

From the page you linked:

The Search Interface

You can search all the metadata by entering search terms in the search bar. Searches are case insensitive.

The screenshot you posted also clearly shows that the word or phrase you're searching for will be matched only in metadata fields (i.e. tags).

From what I could find Calibre doesn't have in-built full-text search. It was listed as being on the developer's TODO list in 2010, but in 2011 (i.e. 4 years ago) he marked the issue as Won't Fix.

This plugin might help you though.

If you open an individual book with Calibre E-Book viewer it has a function to search text within a book.

Karan
  • 55,947
  • 20
  • 119
  • 191
  • Personally, I couldn't get the plugin to install, because it seems to be only meant to run on Linux ([screenshot of error](https://gyazo.com/a6d5907b72bf15501e86705ef30e1419)), but YMMV. However, as this answer mentioned in the last paragraph, opening the individual book, right-clicking the top half and selecting "Search" worked wonders ([Screenshot](https://gyazo.com/f3391cdaa18a1b1dc4ed59ab1f5f48f1)). :) – Matias Apr 14 '20 at 07:39
1

The way I do it is with Devonthink Pro Office (which I'll refer to as DT). I use DT to create a searchable index at the base of the library rather than copy books into DT. DT has a very flexible/powerful search vocabulary. This works exceptionally well. After adding new books, I tell DT to update its index via File > Update index.... Additionally, DT ships with Abby Fine Reader integrated, so I use that to convert any PDFs into a searchable format if they are not currently. This also works exceptionally well.

Joe
  • 153
  • 7
0

The MCS (Multi-Colum-Index) Plugin allows you to build a full-text word index, or to search with regex. MCS Index Plugin UI

It follows Calibre's User Interface guidelines to the dot, so the UI probably doesn't need much explanation. In any case: You want to use the second section on the "Word Queries" tab to build your index, then search using the top section.

The indexing works only with the txt format (not epub/mobi/etc., and also not txtz). So you will want to convert your library to .txt before indexing.

There's also another full text search plugin that seems more focussed, but it relies on software not available for MacOS, so I did not have a chance to try it.

0

As phrased, the question seems to exclude my answer, because the search is not performed within Calibre, but it appears to be the best solution for my use case, so might be helpful to add here.

  • Use Calibre to convert all books to plain text.
  • Optionally, merge all of the plain text books into a single "book," depending on your preferred search tool (I think you can convert and merge in one job instead of two, but only if the books are all in the same format).
  • Search the new text file(s) with grep, Search > Find in Files (Ctrl+Shift+F) in Notepad++, or whichever search tool you prefer. Obviously a lot of options, including grep, are happy to search the contents of multiple files at once, so merging the books isn't strictly necessary - but a single file is arguably tidier, so may be better for many people's purposes.

Based primarily on this question about grep on ebooks, it seems that a more elegant solution using only Calibre or only a few CLI commands piped together should be possible, but depending on what you want to do next, my solution is only marginally worse or just as good in practice (just aesthetically unpleasant).

For example, if you want to go directly from the search results to a match in the original ebook, my solution might be pretty tedious to use. But "whatever tool you prefer" could mean an elaborate script you wrote which uses grep or similar to find matches in the text file(s), then allows you to select a match, then makes use of Calibre CLI to open the book in Calibre and use Calibre's normal single book search function to search for the text it found with grep.

My more complex option unfortunately includes virtually no explanation of how to accomplish all of that, but just converting books to text and doing a simple search might be a perfectly efficient solution for OP and a lot of other people.

Humaj
  • 1
  • 1