Smart Groups - Multiple Search Conditions

A place for users to ask each other questions, make suggestions, and discuss Bookends.
Post Reply
dtan
Posts: 3
Joined: Wed Oct 08, 2014 1:07 pm

Smart Groups - Multiple Search Conditions

Post by dtan »

Hi I'm trying to use the Smart Groups to search the following

house and (eat or sleep)
so when I set up the smart folder, can it be

option 1
Option 1
Option 1
Screen Shot 2014-10-09 at 1.40.30 am.png (81.44 KiB) Viewed 6579 times
or
option 2
Option 2
Option 2
Screen Shot 2014-10-09 at 1.41.10 am.png (96.25 KiB) Viewed 6579 times

or
option 3
should I create a static group containing a smart group "house"
Then create another smart group searching for - eat, or sleep, and is in the static group house
(It seems that option 3 creates too many groups/folders on the side bar)

Would love to hear the most streamlined method.

I have read the user guide and played around a bit with the smart searches but testing with a small database, I can't be sure if option 2 works correctly.
Thanks for your help!

Dee
Jon
Site Admin
Posts: 10048
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Smart Groups - Multiple Search Conditions

Post by Jon »

The first option, although it's possible that it may not give you exactly what you want. It parses to house AND eat OR sleep. I believe that is the equivalent of (house AND eat) OR sleep.

Perhaps this would be better:

search1 = house AND eat
search2 = house AND sleep

Select both (and tell Bookends to OR the results of this virtual search).

Jon
Sonny Software
dtan
Posts: 3
Joined: Wed Oct 08, 2014 1:07 pm

Re: Smart Groups - Multiple Search Conditions

Post by dtan »

Hi Jon,

when you say search 1 and 2,
does it mean creating 2 smart groups?
There isn't a way to do it in one?

For example, if I want to capture everything about eating and food in the house,
it would be house AND (eat or eating or food)

does this mean I have to make 3 searches or as many as there are variants of the food?

Also, please correct me if I'm wrong but virtual groups are not saved right?
Jon
Site Admin
Posts: 10048
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Smart Groups - Multiple Search Conditions

Post by Jon »

The boolean operations are performed in sequence, there are no parentheses (groupings). So the search would be house AND eat OR eating OR food.

A virtual group is simply what happens when you select multiple groups. Bookends will either AND or OR these groups (that setting is in the Action popup menu beneath the groups pane, or available via a right-click).

Jon
Sonny Software
Jon
Site Admin
Posts: 10048
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Smart Groups - Multiple Search Conditions

Post by Jon »

Note that a smart SQL search lets you access the full complement of complex searches that Bookends can do. Please see the user guide (look for "sql search") for a detailed discussion of how sql searches are constructed. Here's one example of your search (you can do much more, such as specify individual fields, do NOT searches, etc.):

allfields='house' AND (allfields='eat' OR allfields='eating' OR allfields='food')

Jon
Sonny Software
paul77
Posts: 6
Joined: Thu Jan 23, 2020 5:57 pm

Re: Smart Groups - Multiple Search Conditions

Post by paul77 »

Jon wrote: Thu Oct 09, 2014 7:37 am The boolean operations are performed in sequence, there are no parentheses (groupings). So the search would be house AND eat OR eating OR food.

[…]

Jon
Sonny Software
I was wondering what exactly it means that logical “operations are performed in sequence”, i.e. what would
A AND B OR C AND D amount to?

There are several possibilities:

(1) ((A AND B) OR C) AND D
This is the literal understanding of “in sequence”.

(2) (A AND B) OR (C AND D)
Here, AND binds stronger than OR, which is standard convention in logics (https://www.wikiwand.com/en/Logical_con ... precedence)

(3) A AND (B OR C) AND D
Here, OR binds stronger than AND, which is non-standard.

I have done some tests and the answer seems to be that the software interprets A AND B OR C AND D by rule (2).
Hence, as long as the logical expression one is requiring is of form (2) one can use the normal smart group; otherwise a SQL/REGEX smart group is required.

By the way, NOT means AND NOT and binds stronger than OR (and equally strong as AND).

Paul
Post Reply