Full-text search (FTS) enables powerful searching capabilities over large text fields. SQLY supports FTS with advanced matching techniques, ranking, and filtering.
The full_text_search operator searches for keywords within text fields.
query:
select: [id, title, content]
from: articles
where:
content:
full_text_search: "machine learning"This query retrieves all articles that mention "machine learning" anywhere in the content.
FTS allows searching for exact phrases and nearby words.
query:
select: [id, title]
from: articles
where:
content:
full_text_search:
phrase: "deep neural networks"This ensures that "deep neural networks" appears exactly as typed.
query:
select: [id, title]
from: articles
where:
content:
full_text_search:
near:
words: ["AI", "ethics"]
distance: 5This finds instances where "AI" and "ethics" appear within 5 words of each other.
SQLY supports ranking results based on relevance.
query:
select: [id, title, rank]
from: articles
where:
content:
full_text_search: "cybersecurity"
order_by: rank DESCThis ranks articles based on how relevant they are to "cybersecurity."
FTS can search across multiple text fields simultaneously.
query:
select: [id, title]
from: articles
where:
or:
- title:
full_text_search: "quantum computing"
- content:
full_text_search: "quantum computing"This searches for "quantum computing" in both the title and content fields.
full_text_searchenables keyword-based search.- Use
phrasefor exact matches andnearfor proximity searches. rankorders results based on relevance.- Multi-field search expands search scope.