Boolean search

A comprehensive guide to boolean logic when searching for content

Lexer Listen allows you to build your queries using boolean language, giving you the flexibility and power to ask all types of questions of your data. Every time you search in Google, you’re using boolean logic. Our products use this same approach, and the options below will help you understand that control.

Search modifiers

There are 8 modifiers that you can use when crafting your search.

Modifiers How it works
AND And is used to combine words and phrases
OR OR is used to expand the results of your search
NOT NOT is used to exclude words and reduce the results of your search
"" Quotation marks are used to indicate a whole phrase
() Parentheses or brackets are used to indicate a component of the entire search.
* Asterisk wildcards are used in conjunction with partial words to return all words that match the structure
? Question mark wildcards are used in conjunction with partial words to return all words that match the structure, but only by one letter
~ Tilde is both a proximity search and a fuzziness search

Modifier examples

Modifier Example Explained
AND AFL AND tickets Will return all mentions of the AFL and tickets. You can also use + in place of AND, as an example "AFL +tickets".
OR AFL OR tickets Will return all mentions of the AFL, as well as all mentions of tickets.
NOT AFL NOT tickets Will return all mentions of the AFL, and exclude any mentions of tickets. You can also use - in place of NOT, as an example "AFL -tickets".
'''' "AFL tickets" Will return any mentions of "AFL tickets" exactly as it displays. If you didn’t use the quotation marks, and instead wrote AFL tickets, the platform will automatically put an OR into the search and make it AFL OR tickets, which is probably not what you want!
() (AFL AND tickets) NOT (scalping OR seats) Makes it explicit that you want AFL AND tickets results, but you want to exclude scalping OR seats. The use of brackets is often where users have issues with creating a string, if your string is broken, pay close to attention to open & closed brackets
* *oodle Replaces the * with any combination or number of letters to form other words, so the example to the left might return "poodle", "noodle", "labradoodle" etc.
? AF? Will return any words that have one letter after AF (ie. AFL, AFW, AFC). Lex?r would return Lexer, Lexar, Lexur, etc.
~ See below tilde is both a proximity search and a fuzziness search. Let’s dig into these a bit deeper below.

Notes on using tilde

Proximity

Tilde is used when you’re looking for words near to other words. The phrase “Gorman Raincoat” expects all the terms in that exact order. However, a proximity query allows the specified words to be further apart or in a different order in a sentence. Just add a ~ after your usual phrase query and specify the maximum number of spaces you’d like between the words. Example: “Gorman Raincoat”~6 would pick up posts like “Gorman makes the best Raincoat around”, “I went to Gorman after pay day and bought a Raincoat” etc.

Fuzziness

Tilde is used when you’re looking for words that are similar to, but not exactly like, your search terms. For example, searching for Lexer~2 will return terms that are a maximum of two changes from the query. A change includes the insertion, deletion or substitution of a single character, or transposition of two adjacent characters. Lexer~1 should be sufficient to catch 80% of all human misspellings. This is very handy if your customers are often misspelling your brand name - i.e. we get Lexar a lot!

Additional info

UTF-8 Characters

UTF-8 characters (eg. é, ß, ü) will only match exactly, even in cases where an “equivalent” ASCII character exists. For example, touché will not match an Object containing “touche”.

Updated:
September 23, 2022
Did this page help you?
Thank you! Your feedback has been received!
Oops! Something went wrong while submitting the form, for assistance please contact support@lexer.io
Welcome to Lexer!
Fundamentals
Getting started
Our glossary
Fundamentals
Getting started
Integrations
Fundamentals
Setup
My account
Fundamentals
Setup
Manage team
Fundamentals
Setup
Group permissions
Fundamentals
Setup
Classifications
Fundamentals
Setup
Out of the box segments
Fundamentals
Setup
Browser guide
Fundamentals
Security
Corporate networks
Fundamentals
Security
Emergency contact
Fundamentals
Security
Multi-factor authentication
Fundamentals
Security
Single sign-on
Fundamentals
Security
Trust and compliance
Fundamentals
Security
Lexer's Identity Resolution
Fundamentals
Identity Resolution
Troubleshooting tech issues
Fundamentals
Troubleshooting
Error code: 503 Service Unavailable
Fundamentals
Troubleshooting
Error code: 401 Unauthorized
Fundamentals
Troubleshooting
Error code: 403 Forbidden
Fundamentals
Troubleshooting
Troubleshooting Activate
Fundamentals
Troubleshooting
Troubleshooting Respond
Fundamentals
Troubleshooting
Help! My data is missing from the Hub
Fundamentals
Troubleshooting
Understanding APIs at Lexer
Data
Data Onboarding
Providing JSON data to Lexer
Data
Data Onboarding
Providing CSV data to Lexer
Data
Data Onboarding
Upload using SFTP
Data
Data Onboarding
Upload using S3
Data
Data Onboarding
Lexer data specification
Data
Lexer Data Specification
Customer data specification
Data
Lexer Data Specification
Commerce data specification
Data
Lexer Data Specification
Marketing data specification
Data
Lexer Data Specification
Compliance data specification
Data
Lexer Data Specification
Data Formatting and Validation
Data
Getting Started with APIs
Authentication and API token creation
Data
Getting Started with APIs
Rate Limits
Data
Getting Started with APIs
Response codes and common errors
Data
Getting Started with APIs
Product imagery
Data
Getting Started with APIs
Currency conversion
Data
Getting Started with APIs
Lexer’s APIs overview
Data
Lexer’s APIs
Dataset management in the Hub
Data
Dataset management
Chatbox user API
Data
Lexer’s APIs
Activity API
Data
Lexer’s APIs
Visualize API
Hidden from nav
Profile Read API
Data
Lexer’s APIs
Lexer Javascript Tag basics
Data
Lexer Javascript Tag
Lexer Javascript Tag technical guide
Data
Lexer Javascript Tag
Lexer Javascript Tag use cases
Data
Lexer Javascript Tag
dataLayer configuration: Shopify
Data
Lexer Javascript Tag
Customer segment CSV export
Data
Data off-boarding
Export to CSV
Data
Data off-boarding
Data in Lexer's CDXP
Understand
Customer Data
Lexer's attributes
Understand
Customer Data
Attribute value types
Understand
Customer Data
Data source - CRM
Understand
Customer Data
Data source - Transactions
Understand
Customer Data
Data source - Email
Understand
Customer Data
Partner data - Experian
Understand
Customer Data
Partner data - Mastercard
Understand
Customer Data
Partner data - Roy Morgan
Understand
Customer Data
GDPR and CCPA requests
Understand
Customer Data
Upload data files
Understand
Customer Data
File upload API
Understand
Customer Data
Data provision and schemas
Understand
Customer Data
Segment overview
Understand
Segment
Creating segments
Understand
Segment
Smart Search
Understand
Segment
Export attribute results
Understand
Segment
Contact a customer
Understand
Segment
Fixing a disabled segment
Understand
Segment
Profile tab
Understand
Segment
Compare segments
Understand
Compare
Compare attributes
Understand
Compare
Activate overview
Engage
Activate
Ongoing activations
Engage
Activate
Audience splits
Engage
Activate
A/B splits
Engage
Activate
Control group splits
Engage
Activate
Inbox filtering
Engage
Respond
Ignored Senders
Engage
Respond
Forms for service
Engage
Respond
Workflow states
Engage
Respond
Bulk changes
Engage
Respond
Scheduled replies
Engage
Respond
Message templates
Engage
Respond
Customer profiles
Engage
Respond
Grouped messages
Engage
Respond
Automation rules
Engage
Respond
Redact messages
Engage
Respond
Track overview
Measure
Track
Activity overview
Measure
Activity
Team report
Measure
Activity
Cases report
Measure
Activity
Listen overview
Measure
Listen
Searching in Listen
Measure
Listen
Tier filters
Measure
Listen
Boolean search
Measure
Listen
Saved dives
Measure
Listen
Email notifications
Measure
Listen
Twitter data
Measure
Listen
Facebook data
Measure
Listen
Instagram data
Measure
Listen
Visualize overview
Measure
Visualize
Curate feed
Measure
Visualize
Report overview
Measure
Report