Boolean mode search

Boolean mode search is a MySQL FULLTEXT search mode that interprets operators in the search expression to control which words must match and how terms are matched. For example, + makes a term required and * enables prefix matching. User-provided search text must be sanitised because these operators have special meaning.

Minimal example

sql
SELECT id FROM items
WHERE MATCH(name) AGAINST (
	'+pizza* +cheese' IN BOOLEAN MODE
);

Learn this concept

Lesson 2.23 · MySQL FULLTEXT search

Used in exercises

Exercise 2.24 · GET /v1/restaurants: search by name
Prerequisite conceptsFULLTEXT index