This is why Boolean strings don’t work

Tony Russell-Rose
Jul 25, 2018 · 3 min read

In our previous posts we explored some of the challenges involved in formulating complex Boolean strings and expressions, and reviewed six of the more innovative alternative solutions. Each of these offers its own unique perspective on how to solve such problems, and their pioneering efforts provide us with a rich set of design insights and principles. In this brief post, we reflect on the shortcomings of the Boolean string itself, and ask ourselves how we might do better.

A legacy format

There are many professions whose work involves finding answers to complex search challenges. In many cases, the default solution is to use Boolean strings (i.e. Boolean expressions represented as a string of characters). For example, recruiters commonly use Boolean strings to source candidates, crafting expressions such as the following:

(“business analyst” or “systems analyst” or “system analyst” or “data analyst” or “requirements analyst” or “functional analyst”) and crystal and report* and analy* and data near analy* and not inventory and not retail and not (ecommerce or “e-commerce” or b2b or b2c)

Advocates in the profession (quite rightly) pride themselves on an ability to ’speak Boolean’. Indeed, some even refer to themselves as ‘Boolean black belts’.

But the format itself leaves a lot to be desired.

First, it is poor at communicating structure. The use of parentheses as delimiters may be commonplace in programming languages and data structures, but when intended for human interpretation, they are invariably coupled with some sort of physical cue such as indentation. In the absence of such visual signals, parentheses can become lost in a sea of alphanumeric characters, and trying to understand the meaning and structure of such expressions induces unnecessary cognitive load.

Second, it doesn’t scale well. As you add terms to a Boolean string, it grows monotonically in length. This may be acceptable for a handful of terms, but as soon as that grows to double figures and beyond, transparency becomes progressively degraded. A common solution to an analogous problem in software engineering is to offer some form of abstraction, so that lower-level details can be progressively hidden and the overall structure revealed. But Boolean strings (in their native form) offer no such facility.

Third, they are very error-prone. How many times have you revised a problematic Boolean string only to find that a missing bracket was the culprit? Or worse still, you find you had the right number of brackets, but in the wrong place, completely changing the semantics of your search?

Each of the above reasons should provide sufficient motivation to pursue an alternative. Taken together, they provide compelling evidence that a change may be due. Moreover, I’d conjecture that most Boolean strings of any complexity are read many more times than they are written. And in that context, we can and should do more to ensure that the effort invested in them is better realized, and that their content can be better understood, optimised and re-used.

In summary

In this brief post we’ve reviewed some of the shortcomings of using Boolean strings to solve complex search problems. In our next post, we’ll review how we have attempted to apply some of the lessons learned in our own work. In advance of that, if you‘d like to try for yourself, head on over to 2dSearch, and let us know what you think.

Originally published at

Data Driven Investor

from confusion to clarity, not insanity

Tony Russell-Rose

Written by

Technology innovator with extensive experience in search and information retrieval. PhD in AI / NLP. Specialist skills in user experience, HCI and human factors

Data Driven Investor

from confusion to clarity, not insanity

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade