Boolean operators in searches

Hi, I was playing around with the new version of Tinderbox and I noticed that it is possible to use some boolean operators in searches. So, if you do cmd-F and introduce “searchtermA | searchtermB” in the search field, you’ll get a list with all the documents that contain one or the other search terms. I discovered this just by coincidence.

This is really great. I knew you could use boolean operators in agents but to be able to use them in searches is really convenient. When I tried to do “searchtermA & searchtermB”, however, it didn’t work.

Does anybody know whether it possible to use other boolean operators to do searches besides the OR operator ‘|’?

Josep M.

Can you post a small file and your test cases, to give us a common point of reference.

As it is is, I don’t believe it was intended that the view pane Find support boolean operators for multi-term queries although regex terms are allowed in Find search strings. IOW, it’s probably not something to keep trying. If you need multi-term queries use an agent.

Regex supports the | operator: (A+)|(B+) matches any number of As or any numbers of Bs.

Regex implicitly supports and: (A+)(B+) matches any number of As follows by any number of Bs. This matches AAB but not BAA, though of course you can do that with a more complex regular expression.

On balance, though, the search bar works best with quick and easy regular expressions; if you need more, agents are a better option.

Thanks for the quick responses.

Yes, I knew using regular expressions was possible in Agent queries. I use them quite extensively and I find this one of the most powerful features in TB.

I don’t know whether it was intended or not but I do find it extremely convenient to be able to use these kinds of operators (as you can use them in Google searches) for queries with the Find function.

Of course, you are totally right that for more complex searches involving regex the agents are the best option. But for quick and simple queries such as “A | B | C” , “A & B & C” or “(A | B) NOT C” agents might be a bit of an overkill and being able to use these operators in simple searches as you can do with Google searches is indeed convenient.

If it doesn’t create any technical problems, I would encourage you to keep this functionality available and indeed extend it a bit more with the addition of the ‘AND’ and ‘NOT’ boolean operators.

The more I work with version 7.5.4, the more I regret not having updated earlier. I couldn’t have been more wrong in my perception that the added features and improvements didn’t benefit my own workflows. The new visualizations of the search results and the addition of user key attributes to the search options make things so much better!

JM

1 Like

Just read through this thread. I have the same need, want to use simple boolean searches in “find”. I know I can use agents but I am sorting through a lot of similar notes and want a quick way of doing and/or combination searches without continually writing agents. I’m still not clear. Is this possible? I tried an or search | and it did work, but an and & goes not seem to. Is there an “and” syntax? thanks.

My understanding is find allows regex matching but not multiple search terms.

Why not make one agent and just edit the query as needed. Don’t want open the Inspector? Make $AgentQuery a Displayed Attributes item for the agent. Just edit the query when needed.

Thanks Mark. Will do (Michael Becker suggested same).
Lew

1 Like

Depending on the structure of your document you can also filter your outline (only works in outline view) using the same syntax as for Agents.

For instance you can use expressions such as $Name.icontains("First") | $Name.icontains("Second") to look for notes that have First of Second in their name. An additional bonus is that you can save the filters between sessions if you use them often so you don’t have to retype them.