![]() |
#1 |
Enthusiast
![]() Posts: 37
Karma: 10
Join Date: Oct 2020
Device: Kindle Paperwhite (1)
|
![]()
Hello,
I have a custom category `genre` that contains sub categories, for example: Code:
entertainment entertainment.comicbook entertainment.humor entertainment.music entertainment.storytelling entertainment.television entertainment.writing Meaning all the books that have an assigned category `entertainment` BUT NONE of the subcategories of `entertainment`? I have tried this search but it doesn't work: Code:
#genre:"=entertainment" AND NOT #genre:"=.entertainment" Any idea? |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,911
Karma: 7076137
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Use the tag browser to see what the search expressions are. For example, click on the "entertainment" genre until you see a green single + sign then look at the search bar.
For more information see "‘Equality’ searches" in "The search interface" in the calibre manual. |
![]() |
![]() |
![]() |
#3 | |
Enthusiast
![]() Posts: 37
Karma: 10
Join Date: Oct 2020
Device: Kindle Paperwhite (1)
|
Quote:
Code:
#genre:"=entertainment" Code:
#genre:"=.entertainment" |
|
![]() |
![]() |
![]() |
#4 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,911
Karma: 7076137
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Quote:
What exactly do you want to do? |
||
![]() |
![]() |
![]() |
#5 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,911
Karma: 7076137
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
If your second post is the question you are asking, then this
Code:
#genre:"=.entertainment" and not #genre:"=entertainment" Code:
#genre:"~^entertainment\." |
![]() |
![]() |
![]() |
#6 | |
Enthusiast
![]() Posts: 37
Karma: 10
Join Date: Oct 2020
Device: Kindle Paperwhite (1)
|
Quote:
I'll try to be more clear: - I have some books that have the top category only, and some books that have the top category AND any of the subcategories. - I need to search which books having the top category don't have any additional subcategories assigned. So logically it would be: lookup the top category only AND exclude any subcategory, but again, my example and also your examples do not work. To me this should be correct: Code:
#genre:"=entertainment" AND NOT #genre:"=.entertainment" |
|
![]() |
![]() |
![]() |
#7 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 39,014
Karma: 153098470
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Something like this with the '.' moved after entertainment?
Code:
#genre:"=entertainment" AND NOT #genre:"=entertainment." |
![]() |
![]() |
![]() |
#8 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,911
Karma: 7076137
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
This search, produced by the tag browser when the single green plus is showing Code:
#genre:"=entertainment" Examples:
|
|
![]() |
![]() |
![]() |
#9 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,911
Karma: 7076137
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
I realized I misunderstood your posts. My apologies. And sorry for being super pedantic in this post. I am "thinking out loud".
To rephrase the question using sets, what (I think) you want is the intersection of two sets Code:
top_level_set ⋂ ~set_of_children
Computing top_level_set is easy using the search Code:
#genre:"=entertainment" Code:
#genre:"=.entertainment" Code:
(top_level_set ∪ set_of_children) Code:
top_level_set ⋂ ~(top_level_set ∪ set_of_children) We must find a search that finds children of entertainment, ignoring entertainment itself. The regexp search in post #5 and alluded to by @DNSB in post 7 Code:
#genre:"~^entertainment\." Putting the two together, the search Code:
#genre:"=entertainment" AND NOT #genre:"~^entertainment\." Code:
top_level_set ⋂ ~set_of_children Last edited by chaley; 02-13-2024 at 07:57 PM. |
![]() |
![]() |
![]() |
Tags |
categories, category, genre, genre hierarchy, search |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Search and Go To controls at the top | lucille | Viewer | 4 | 04-12-2022 02:52 AM |
How to create virtual library to match the top most level category. | hlhp | Library Management | 2 | 03-21-2021 08:01 AM |
Saved Search window off top of screen? | Phssthpok | Editor | 2 | 11-26-2020 05:13 AM |
Putting sideloaded book in the Books category instead of Docs category | hopla | Amazon Kindle | 5 | 10-29-2018 06:40 PM |
Smart Search when Adding Category Information | Teeg | Calibre | 1 | 04-11-2018 07:59 AM |