View Single Post
Old 07-23-2020, 05:38 AM   #1
mapozyan
Connoisseur
mapozyan composes epic poetry in binary.mapozyan composes epic poetry in binary.mapozyan composes epic poetry in binary.mapozyan composes epic poetry in binary.mapozyan composes epic poetry in binary.mapozyan composes epic poetry in binary.mapozyan composes epic poetry in binary.mapozyan composes epic poetry in binary.mapozyan composes epic poetry in binary.mapozyan composes epic poetry in binary.mapozyan composes epic poetry in binary.
 
Posts: 77
Karma: 90088
Join Date: Jul 2020
Device: android
[GUI Plugin] Power (Full-text) Search

Calibre Power Search Plugin
===========================

Version 2.2.0, released on 27 March 2022. Created by Michael Apozyan
Platform: Linux, Windows, macOS
Calibre versions: 3.x, 4.x, 5.x, 6.x


Overview

This plugin adds full-text search functionality to your electronic library. Default shortcut key for Power Search dialog is Ctrl+Shift+S.
When you run Power Search, it will extract text from all your books on the fly and load all this text in a local full-text search engine. Plugin will never modify any books and records in Calibre library. As a search backend, we are using ElasticSearch. Once the search index is created and is up-to-date, Power Search will query search engine and display list of books where certain search keywords are found.
For large libraries, running search for the first time might take a while. Subsequent searches will normally take less than a second.

Usage

We tried to make Power Search easy to use. And yet it allows you running complex queries too.
  • When you enter a query with multiple words, Power Serach will try to find all of the books that contain all of your query words. However, it won't be a phrase search, i.e. your query words might appear in different parts of the text.
    If you wish to search for a particular phrase, put it in double quotes.
    Example: "independence day"
  • If you need to exclude documents containing specific word, prepend it with a minus sign.
    Example: good -bad
  • To find books containing any of given words, use | operator (which means OR).
    Example: good | bad
  • You can write complex expression by using round brackets.
    Example: (good | bad) pizza
  • Power Search supports wildcard search with * (any number of characters) and ? (one character) symbols.
    Example: math*
  • It's possible to write even more complex queries by using regular expressions put in forward slashes:
    Example: /14[1-2][0-9]/ renaissance

Requirements
  • ElasticSearch >= 6.x

    In order to use Power Search Plugin, you need to have ElasticSearch service up and running.
    For local setup, just download ElasticSearch package from the official website
    https://www.elastic.co/downloads/elasticsearch and unzip it in any folder.

    If your system stays in trusted network (like your home network) and hence you are not much
    concerned about fulltext data security, you may simplify configuring ElasticSearch by
    disabling security module. Just go to config/elasticsearch.yml and add or modify following
    configuration value:

    xpack.security.enabled: false

  • Pdftotext utility (optional, but highly recommended)

    Generally, Power Search Plugin is using Calibre's native converters to build full-text index.
    However, native PDF conversion is sometimes working too slowly. To speed up this process, you
    can install pdftotext utility and plugin will make use of it. Pdftotext is part of Xpdf and
    Poppler projects.

    Here are some hints:

    - Xpdf package can be found here (look for "Xpdf command line tools")
    https://www.xpdfreader.com/download.html

    - For Debian/Ubuntu, check for 'xpdf' or 'libpoppler' apt packages.

Configuring
  • ElasticSearch engine network path
    If you installed ElasticSearch locally, it will usually be available at http://localhost:9200/ so you don't need to modify this setting. However, you can change it if you need different setup.
  • ElasticSearch engine local path (optional)
    Example: c:\programs\elasticsearch-7.8.1
    If you plan to run ElasticSearch locally, Power Search might be set up to launch it in the background when needed. Just point here to the home directory where ElasticSearch is located.
    Note that in this case Power Search will manage to stop ElasticSearch when you close Calibre.
  • Path to pdftotext tool (optional)
    If pdftotext tool can not be found in PATH, enter the full path to pdftotext executable file.
  • Number of parallel processes for text extraction
    By default this number is equal to number of CPUs on your system minus one. You can change this value if neccessary.
  • Index book formats
    You can enable/disable specific book file formats that should be indexed.
  • Automatically index new books on search
    You can enable/disable an option of discovering new books and indexing them each time you run
    the search.


Version History:

Spoiler:


Version 2.2.0 - 27 March 2022
Add Calibre 6 support

Version 2.1.2 - 20 February 2022
Fixed crash on multi-display environments
Fixed limit of max 10k results

Version 2.1.1 - 24 October 2021
Minor fixes

Version 2.1.0 - 16 June 2021
Support for multiple libraries
Add dropdown menu to Search button
Bugfixes

Version 2.0.1 - 04 April 2021
Bugfix

Version 2.0.0 - 29 March 2021
Major feature update

Version 1.7.0 - 04 November 2020
Major feature update

Version 1.6.0 - 25 September 2020
Calibre 5 support

Version 1.5.0 - 08 September 2020
macOS support
Usability improvements

Version 1.4.0 - 24 August 2020
Usability improvements

Version 1.3.0 - 08 August 2020
Support for complex queries

Version 1.2.0 - 31 July 2020
Usability improvements

Version 1.1.1 - 27 July 2020
Bugfix

Version 1.1.0 - 26 July 2020
Add Windows support

Version 1.0.0 - 23 July 2020
Initial Linux release


Feedback

For bug reports and feature requests please contact mapozyan (at) yahoo.com
The project is hosted on GitHub at https://github.com/mapozyan/caps

Authors
  • mapozyan
  • thiago.ecc

Thanks to
  • ownedbycats - for testing and ideas
  • DNSB - for providing help to the community
Attached Thumbnails
Click image for larger version

Name:	screenshot.png
Views:	418
Size:	102.2 KB
ID:	195013  
Attached Files
File Type: zip Calibre Power Search Plugin.2.2.0.zip (1.69 MB, 31704 views)

Last edited by mapozyan; 07-11-2023 at 06:53 PM. Reason: Add Calibre 6 support
mapozyan is offline   Reply With Quote