Changesets · Branches · Tags · Compare
| Changeset | 1923a0cab4967aa4828103587c313d636f6685f39b9ddeec2d7b01cd2f95fd0d |
|---|---|
| Author | BubbleCal <bubble-cal@outlook.com> · 2024-09-11 10:18 +08:00 |
| Committer | GitHub <noreply@github.com> · 2024-09-11 10:18 +08:00 |
| Parents | 28b4ece08dc9 |
5 files changed
modified docs/src/fts.md +1 −1
| @@ -205,7 +205,7 @@ | ||
| 205 | 205 | ## Phrase queries vs. terms queries |
| 206 | 206 | |
| 207 | 207 | !!! warning "Warn" |
| 208 | - Lance-based FTS doesn't support queries combining by boolean operators `OR`, `AND`. | |
| 208 | + Lance-based FTS doesn't support queries using boolean operators `OR`, `AND`. | |
| 209 | 209 | |
| 210 | 210 | For full-text search you can specify either a **phrase** query like `"the old man and the sea"`, |
| 211 | 211 | or a **terms** search query like `"(Old AND Man) AND Sea"`. For more details on the terms |
modified nodejs/__test__/table.test.ts +1 −1
| @@ -872,7 +872,7 @@ | ||
| 872 | 872 | ]; |
| 873 | 873 | const table = await db.createTable("test", data); |
| 874 | 874 | await table.createIndex("text", { |
| 875 | - config: Index.fts({ withPositions: false }), | |
| 875 | + config: Index.fts({ withPosition: false }), | |
| 876 | 876 | }); |
| 877 | 877 | |
| 878 | 878 | const results = await table.search("hello").toArray(); |
modified nodejs/lancedb/indices.ts +2 −2
| @@ -142,7 +142,7 @@ | ||
| 142 | 142 | * If set to false, the index will not store the positions of the tokens in the text, |
| 143 | 143 | * which will make the index smaller and faster to build, but will not support phrase queries. |
| 144 | 144 | */ |
| 145 | - withPositions?: boolean; | |
| 145 | + withPosition?: boolean; | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | export class Index { |
| @@ -244,7 +244,7 @@ | ||
| 244 | 244 | * For now, the full text search index only supports English, and doesn't support phrase search. |
| 245 | 245 | */ |
| 246 | 246 | static fts(options?: Partial<FtsOptions>) { |
| 247 | - return new Index(LanceDbIndex.fts(options?.withPositions)); | |
| 247 | + return new Index(LanceDbIndex.fts(options?.withPosition)); | |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | /** |
modified python/python/lancedb/table.py +1 −1
| @@ -505,7 +505,7 @@ | ||
| 505 | 505 | Only available with use_tantivy=False |
| 506 | 506 | If False, do not store the positions of the terms in the text. |
| 507 | 507 | This can reduce the size of the index and improve indexing speed. |
| 508 | - But it will not be possible to use phrase queries. | |
| 508 | + But it will raise an exception for phrase queries. | |
| 509 | 509 | |
| 510 | 510 | """ |
| 511 | 511 | raise NotImplementedError |
modified python/python/tests/test_fts.py +1 −1
| @@ -143,7 +143,7 @@ | ||
| 143 | 143 | @pytest.mark.parametrize("with_position", [True, False]) |
| 144 | 144 | def test_create_inverted_index(table, use_tantivy, with_position): |
| 145 | 145 | if use_tantivy and not with_position: |
| 146 | - pytest.skip("we don't support to build tantivy index without position") | |
| 146 | + pytest.skip("we don't support building a tantivy index without position") | |
| 147 | 147 | table.create_fts_index("text", use_tantivy=use_tantivy, with_position=with_position) |
| 148 | 148 | |
| 149 | 149 |