Quote:
Originally Posted by groob
Thanks for your help,
I'll try to be more clear:
[...]
|
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
where
- top_level_set is the books that contain the bare (top-level) genre "entertainment".
- set_of_children is the books that contain children of "entertainment".
Computing top_level_set is easy using the search
Code:
#genre:"=entertainment"
Computing set_of_children is more problematic. As you noted, the search
Code:
#genre:"=.entertainment"
can't be used for set_of_children because the search builds the set
Code:
(top_level_set ∪ set_of_children)
The expression
Code:
top_level_set ⋂ ~(top_level_set ∪ set_of_children)
is the empty set.
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\."
builds set_of_children by finding the set of books where "entertainment" is followed by a period.
Putting the two together, the search
Code:
#genre:"=entertainment" AND NOT #genre:"~^entertainment\."
builds the intersection we want
Code:
top_level_set ⋂ ~set_of_children
These screen captures shows that the search works. The first shows the books without a search. The second shows the books after applying the search.