Skip to content

Commit 1ef24d4

Browse files
authored
docs: refresh search function guide for query syntax (#2860)
1 parent d0a663a commit 1ef24d4

File tree

4 files changed

+317
-237
lines changed

4 files changed

+317
-237
lines changed

β€Ždocs/en/sql-reference/20-sql-functions/10-search-functions/index.mdβ€Ž

Lines changed: 65 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,91 @@
22
title: Full-Text Search Functions
33
---
44

5-
This section provides reference information for the full-text search functions in Databend. These functions enable powerful text search capabilities similar to those found in dedicated search engines.
5+
Databend's full-text search functions deliver search-engine-style filtering for semi-structured `VARIANT` data and plain text columns that are indexed with an inverted index. They are ideal for AI-generated metadataβ€”such as perception results from autonomous-driving video framesβ€”stored alongside your assets.
66

77
:::info
8-
Databend's full-text search functions are inspired by [Elasticsearch Full-Text Search Functions](https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-functions-search.html).
8+
Databend's search functions are inspired by [Elasticsearch Full-Text Search Functions](https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-functions-search.html).
99
:::
1010

11+
Include an inverted index in the table definition for the columns you plan to search:
12+
13+
```sql
14+
CREATE OR REPLACE TABLE frames (
15+
id INT,
16+
meta VARIANT,
17+
INVERTED INDEX idx_meta (meta)
18+
);
19+
```
20+
1121
## Search Functions
1222

1323
| Function | Description | Example |
14-
|----------|-------------|--------|
15-
| [MATCH](match) | Searches for documents containing specified keywords in selected columns | `MATCH('title, body', 'technology')` |
16-
| [QUERY](query) | Searches for documents satisfying a specified query expression with advanced syntax | `QUERY('title:technology AND society')` |
17-
| [SCORE](score) | Returns the relevance score of search results when used with MATCH or QUERY | `SELECT title, SCORE() FROM articles WHERE MATCH('title', 'technology')` |
24+
|----------|-------------|---------|
25+
| [MATCH](match) | Performs a relevance-ranked search across the listed columns. | `MATCH('summary, tags', 'traffic light red')` |
26+
| [QUERY](query) | Evaluates a Lucene-style query expression, including nested `VARIANT` fields. | `QUERY('meta.signals.traffic_light:red')` |
27+
| [SCORE](score) | Returns the relevance score for the current row when used with `MATCH` or `QUERY`. | `SELECT summary, SCORE() FROM frame_notes WHERE MATCH('summary, tags', 'traffic light red')` |
1828

19-
## Usage Examples
29+
## Query Syntax Examples
2030

21-
### Basic Text Search
31+
### Example: Single Keyword
2232

2333
```sql
24-
-- Search for documents with 'technology' in title or body columns
25-
SELECT * FROM articles
26-
WHERE MATCH('title, body', 'technology');
34+
SELECT id, meta['frame']['timestamp'] AS ts
35+
FROM frames
36+
WHERE QUERY('meta.detections.label:pedestrian')
37+
LIMIT 100;
2738
```
2839

29-
### Advanced Query Expressions
40+
### Example: Boolean AND
3041

3142
```sql
32-
-- Search for documents with 'technology' in title and 'impact' in body
33-
SELECT * FROM articles
34-
WHERE QUERY('title:technology AND body:impact');
43+
SELECT id, meta['frame']['timestamp'] AS ts
44+
FROM frames
45+
WHERE QUERY('meta.signals.traffic_light:red AND meta.vehicle.lane:center')
46+
LIMIT 100;
3547
```
3648

37-
### Relevance Scoring
49+
### Example: Boolean OR
3850

3951
```sql
40-
-- Search with relevance scoring and sorting by relevance
41-
SELECT title, body, SCORE()
42-
FROM articles
43-
WHERE MATCH('title^2, body', 'technology')
44-
ORDER BY SCORE() DESC;
52+
SELECT id, meta['frame']['timestamp'] AS ts
53+
FROM frames
54+
WHERE QUERY('meta.signals.traffic_light:red OR meta.detections.label:bike')
55+
LIMIT 100;
4556
```
4657

47-
Before using these functions, you need to create an inverted index on the columns you want to search:
58+
### Example: IN List
4859

4960
```sql
50-
CREATE INVERTED INDEX idx ON articles(title, body);
51-
```
61+
SELECT id, meta['frame']['timestamp'] AS ts
62+
FROM frames
63+
WHERE QUERY('meta.tags:IN [stop urban]')
64+
LIMIT 100;
65+
```
66+
67+
### Example: Inclusive Range
68+
69+
```sql
70+
SELECT id, meta['frame']['timestamp'] AS ts
71+
FROM frames
72+
WHERE QUERY('meta.vehicle.speed_kmh:[0 TO 10]')
73+
LIMIT 100;
74+
```
75+
76+
### Example: Exclusive Range
77+
78+
```sql
79+
SELECT id, meta['frame']['timestamp'] AS ts
80+
FROM frames
81+
WHERE QUERY('meta.vehicle.speed_kmh:{0 TO 10}')
82+
LIMIT 100;
83+
```
84+
85+
### Example: Boosted Fields
86+
87+
```sql
88+
SELECT id, meta['frame']['timestamp'] AS ts, SCORE()
89+
FROM frames
90+
WHERE QUERY('meta.signals.traffic_light:red^1.0 AND meta.tags:urban^2.0')
91+
LIMIT 100;
92+
```

β€Ždocs/en/sql-reference/20-sql-functions/10-search-functions/match.mdβ€Ž

Lines changed: 53 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import FunctionDescription from '@site/src/components/FunctionDescription';
55

66
<FunctionDescription description="Introduced or updated: v1.2.619"/>
77

8-
Searches for documents containing specified keywords. Please note that the MATCH function can only be used in a WHERE clause.
8+
`MATCH` searches for rows that contain the supplied keywords within the listed columns. The function can only appear in a `WHERE` clause.
99

1010
:::info
1111
Databend's MATCH function is inspired by Elasticsearch's [MATCH](https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-functions-search.html#sql-functions-search-match).
@@ -14,83 +14,62 @@ Databend's MATCH function is inspired by Elasticsearch's [MATCH](https://www.ela
1414
## Syntax
1515

1616
```sql
17-
MATCH( '<columns>', '<keywords>'[, '<options>'] )
17+
MATCH('<columns>', '<keywords>'[, '<options>'])
1818
```
1919

20-
| Parameter | Description |
21-
|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
22-
| `<columns>` | A comma-separated list of column names in the table to search for the specified keywords, with optional weighting using the syntax (^), which allows assigning different weights to each column, influencing the importance of each column in the search. |
23-
| `<keywords>` | The keywords to match against the specified columns in the table. This parameter can also be used for suffix matching, where the search term followed by an asterisk (*) can match any number of characters or words. |
24-
| `<options>` | A set of configuration options, separated by semicolons `;`, that customize the search behavior. See the table below for details. |
20+
- `<columns>`: A comma-separated list of columns to search. Append `^<boost>` to weight a column higher than the others.
21+
- `<keywords>`: The terms to search for. Append `*` for suffix matching, for example `rust*`.
22+
- `<options>`: An optional semicolon-separated list of `key=value` pairs fine-tuning the search.
2523

26-
| Option | Description | Example | Explanation |
27-
|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
28-
| fuzziness | Allows matching terms within a specified Levenshtein distance. `fuzziness` can be set to 1 or 2. | SELECT id, score(), content FROM t WHERE match(content, 'box', 'fuzziness=1'); | When matching the query term "box", `fuzziness=1` allows matching terms like "fox", since "box" and "fox" have a Levenshtein distance of 1. |
29-
| operator | Specifies how multiple query terms are combined. Can be set to OR (default) or AND. OR returns results containing any of the query terms, while AND returns results containing all query terms. | SELECT id, score(), content FROM t WHERE match(content, 'action works', 'fuzziness=1;operator=AND'); | With `operator=AND`, the query requires both "action" and "works" to be present in the results. Due to `fuzziness=1`, it matches terms like "Actions" and "words", so "Actions speak louder than words" is returned. |
30-
| lenient | Controls whether errors are reported when the query text is invalid. Defaults to `false`. If set to `true`, no error is reported, and an empty result set is returned if the query text is invalid. | SELECT id, score(), content FROM t WHERE match(content, '()', 'lenient=true'); | If the query text `()` is invalid, setting `lenient=true` prevents an error from being thrown and returns an empty result set instead. |
24+
## Options
25+
26+
| Option | Values | Description | Example |
27+
|--------|--------|-------------|---------|
28+
| `fuzziness` | `1` or `2` | Matches keywords within the specified Levenshtein distance. | `MATCH('summary, tags', 'pedestrain', 'fuzziness=1')` matches rows that contain the correctly spelled `pedestrian`. |
29+
| `operator` | `OR` (default) or `AND` | Controls how multiple keywords are combined when no boolean operator is specified. | `MATCH('summary, tags', 'traffic light red', 'operator=AND')` requires both words. |
30+
| `lenient` | `true` or `false` | When `true`, suppresses parsing errors and returns an empty result set. | `MATCH('summary, tags', '()', 'lenient=true')` returns no rows instead of an error. |
3131

3232
## Examples
3333

34+
In many AI pipelines you may capture structured metadata in a `VARIANT` column while also materializing human-readable summaries for search. The following example stores dashcam frame summaries and tags that were extracted from the JSON payload.
35+
36+
### Example: Build Searchable Summaries
37+
38+
```sql
39+
CREATE OR REPLACE TABLE frame_notes (
40+
id INT,
41+
camera STRING,
42+
summary STRING,
43+
tags STRING,
44+
INVERTED INDEX idx_notes (summary, tags)
45+
);
46+
47+
INSERT INTO frame_notes VALUES
48+
(1, 'dashcam_front',
49+
'Green light at Market & 5th with pedestrian entering the crosswalk',
50+
'downtown commute green-light pedestrian'),
51+
(2, 'dashcam_front',
52+
'Vehicle stopped at Mission & 6th red traffic light with cyclist ahead',
53+
'stop urban red-light cyclist'),
54+
(3, 'dashcam_front',
55+
'School zone caution sign in SOMA with pedestrian waiting near crosswalk',
56+
'school-zone caution pedestrian');
57+
```
58+
59+
### Example: Boolean AND
60+
61+
```sql
62+
SELECT id, summary
63+
FROM frame_notes
64+
WHERE MATCH('summary, tags', 'traffic light red', 'operator=AND');
65+
-- Returns id 2
66+
```
67+
68+
### Example: Fuzzy Matching
69+
3470
```sql
35-
CREATE TABLE test(title STRING, body STRING);
36-
37-
CREATE INVERTED INDEX idx ON test(title, body);
38-
39-
INSERT INTO test VALUES
40-
('The Importance of Reading', 'Reading is a crucial skill that opens up a world of knowledge and imagination.'),
41-
('The Benefits of Exercise', 'Exercise is essential for maintaining a healthy lifestyle.'),
42-
('The Power of Perseverance', 'Perseverance is the key to overcoming obstacles and achieving success.'),
43-
('The Art of Communication', 'Effective communication is crucial in everyday life.'),
44-
('The Impact of Technology on Society', 'Technology has revolutionized our society in countless ways.');
45-
46-
-- Retrieve documents where the 'title' column matches 'art power'
47-
SELECT * FROM test WHERE MATCH('title', 'art power');
48-
49-
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
50-
β”‚ title β”‚ body β”‚
51-
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
52-
β”‚ The Power of Perseverance β”‚ Perseverance is the key to overcoming obstacles and achieving success. β”‚
53-
β”‚ The Art of Communication β”‚ Effective communication is crucial in everyday life. β”‚
54-
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
55-
56-
-- Retrieve documents where the 'title' column contains values that start with 'The' followed by any characters
57-
SELECT * FROM test WHERE MATCH('title', 'The*')
58-
59-
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
60-
β”‚ title β”‚ body β”‚
61-
β”‚ Nullable(String) β”‚ Nullable(String) β”‚
62-
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
63-
β”‚ The Importance of Reading β”‚ Reading is a crucial skill that opens up a world of knowledge and imagination. β”‚
64-
β”‚ The Benefits of Exercise β”‚ Exercise is essential for maintaining a healthy lifestyle. β”‚
65-
β”‚ The Power of Perseverance β”‚ Perseverance is the key to overcoming obstacles and achieving success. β”‚
66-
β”‚ The Art of Communication β”‚ Effective communication is crucial in everyday life. β”‚
67-
β”‚ The Impact of Technology on Society β”‚ Technology has revolutionized our society in countless ways. β”‚
68-
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
69-
70-
-- Retrieve documents where either the 'title' or 'body' column matches 'knowledge technology'
71-
SELECT *, score() FROM test WHERE MATCH('title, body', 'knowledge technology');
72-
73-
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
74-
β”‚ title β”‚ body β”‚ score() β”‚
75-
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
76-
β”‚ The Importance of Reading β”‚ Reading is a crucial skill that opens up a world of knowledge and imagination. β”‚ 1.1550591 β”‚
77-
β”‚ The Impact of Technology on Society β”‚ Technology has revolutionized our society in countless ways. β”‚ 2.6830134 β”‚
78-
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
79-
80-
-- Retrieve documents where either the 'title' or 'body' column matches 'knowledge technology', with weighted importance on both columns
81-
SELECT *, score() FROM test WHERE MATCH('title^5, body^1.2', 'knowledge technology');
82-
83-
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
84-
β”‚ title β”‚ body β”‚ score() β”‚
85-
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
86-
β”‚ The Importance of Reading β”‚ Reading is a crucial skill that opens up a world of knowledge and imagination. β”‚ 1.3860708 β”‚
87-
β”‚ The Impact of Technology on Society β”‚ Technology has revolutionized our society in countless ways. β”‚ 7.8053584 β”‚
88-
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
89-
90-
-- Retrieve documents where the 'body' column contains both "knowledge" and "imagination" (allowing for minor typos).
91-
SELECT * FROM test WHERE MATCH('body', 'knowledg imaginatio', 'fuzziness = 1; operator = AND');
92-
93-
-[ RECORD 1 ]-----------------------------------
94-
title: The Importance of Reading
95-
body: Reading is a crucial skill that opens up a world of knowledge and imagination.
96-
```
71+
SELECT id, summary
72+
FROM frame_notes
73+
WHERE MATCH('summary^2, tags', 'pedestrain', 'fuzziness=1');
74+
-- Returns ids 1 and 3
75+
```

0 commit comments

Comments
Β (0)