Historical context on why Boolean mode was out of scope for the initial implementation:
|
"word1 word2"
)This is used to search for exact phrases, with:
Exact order
No extra words in between
No variations
MATCH(content) AGAINST('"gene therapy" IN BOOLEAN MODE) |
Matches:
"gene therapy is promising"
Doesnβt match:
"therapy for gene mutation"
"gene-based cell therapy"
Phrase matching is strict β it's looking for gene
immediately followed by therapy
.
"word1 word2" @N
)This is used to search for all words appearing close together, regardless of order, and allows for flexibility in between.
MATCH(content) AGAINST('"gene therapy" @3' IN BOOLEAN MODE) |
Matches:
"gene therapy is promising"
β
(distance: 1)
"therapy for gene mutation"
β
(distance: 2 β therapy
, for
, gene
)
"a therapy based on gene editing"
β
(distance: 3 β within threshold)
Doesnβt match:
"gene expression has little relation to cell therapy"
β (too far apart)
So while "gene therapy"
(phrase) only matches that exact sequence, "gene therapy" @3
allows them to be near each other in any order and with some wiggle room between them.
Feature | Phrase Match | Proximity Match |
---|---|---|
Word Order Matters | β Yes | β No |
Must be Adjacent | β Yes | β No (within N words) |
Allows Intervening Words | β No | β Yes (up to N-1 words) |
Use Case | Exact matches (e.g., quotes) | Conceptual closeness |
Flexibility | β Rigid | β Flexible |
Available in BOOLEAN MODE? | β Yes | β Yes (InnoDB only) |
Use phrase matching when you're looking for exact quotations or tight phrases (e.g., "climate change", "artificial intelligence").
Use proximity search when you're more interested in conceptual relevance, especially in large or noisy text fields (e.g., medical records, article abstracts, etc.).