Feature request: “Exclusive” search mode

Bug #1822475 reported by Jeff
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
Unassigned

Bug Description

FEATURE: Is it possible to enable distinct search modes “inclusive” and “exclusive”?

Currently, I’d call the implicit mode “inclusive”, meaning that any search expression for a given field matches items that “at least” include the searched value, whether or not the searched field contains additional values as well (the specified mode would only really make a difference when searching multi-value fields). For example, the current “inclusive” search for Field1:”=Tag1” matches all items containing a value of Tag1 in Field1, regardless of whether or not those items also contain additional values in Field1, such as Tag2.

The “exclusive” mode I am proposing would match items containing exactly the searched values in the specified field – no more, no less. Field1:”=Tag1” would match items that contain only Tag1 in Field1 and not items that contain Tag1 and Tag2, Tag1 and Tag3, etc. All values for fields not mentioned in the search expression at all would continue to be included just as they are today.

EXAMPLE: If I have a large collection of articles and want to find those that address only a given topic and no others (perhaps I feel that the discussion of the desired topic will be more in depth than in articles which address multiple topics), I must create a search expression that includes the topic I want and then manually exclude all others, one by one. Creating a virtual library from the current search helps by removing tag values that are not present in any of the articles containing my desired topic, but still leaves me in the position of having to manually exclude each remaining topic one by one.

If this sounds like a worthwhile idea, the indicator for “inclusive” vs. “exclusive” search could potentially be housed as a radio button in the “Advanced Search” dialog window, similar to the setup of “Search type when selecting multiple items” in the Tag Browser. Appreciate your time and consideration.

Revision history for this message
Kovid Goyal (kovid) wrote :

As far as I can tell you want to search for books containing only a single tag? If so, the following will do it for you:

tags:=Whatever AND tags:#=1

this searches for books with only a single tag that is Whatever.

See https://manual.calibre-ebook.com/gui.html#the-search-interface

for details.

Changed in calibre:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.