Elffuss BraidHub

kikocis/lancedb public

docs: improve the docs and API param name (#1629)

Signed-off-by: BubbleCal <bubble-cal@outlook.com>
Changeset1923a0cab4967aa4828103587c313d636f6685f39b9ddeec2d7b01cd2f95fd0d
AuthorBubbleCal <bubble-cal@outlook.com> · 2024-09-11 10:18 +08:00
CommitterGitHub <noreply@github.com> · 2024-09-11 10:18 +08:00
Parents28b4ece08dc9

Browse the files at this changeset

5 files changed

modified docs/src/fts.md +1 −1
@@ -205,7 +205,7 @@
205205 ## Phrase queries vs. terms queries
206206
207207 !!! 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`.
209209
210210 For full-text search you can specify either a **phrase** query like `"the old man and the sea"`,
211211 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 @@
872872 ];
873873 const table = await db.createTable("test", data);
874874 await table.createIndex("text", {
875- config: Index.fts({ withPositions: false }),
875+ config: Index.fts({ withPosition: false }),
876876 });
877877
878878 const results = await table.search("hello").toArray();
modified nodejs/lancedb/indices.ts +2 −2
@@ -142,7 +142,7 @@
142142 * If set to false, the index will not store the positions of the tokens in the text,
143143 * which will make the index smaller and faster to build, but will not support phrase queries.
144144 */
145- withPositions?: boolean;
145+ withPosition?: boolean;
146146 }
147147
148148 export class Index {
@@ -244,7 +244,7 @@
244244 * For now, the full text search index only supports English, and doesn't support phrase search.
245245 */
246246 static fts(options?: Partial<FtsOptions>) {
247- return new Index(LanceDbIndex.fts(options?.withPositions));
247+ return new Index(LanceDbIndex.fts(options?.withPosition));
248248 }
249249
250250 /**
modified python/python/lancedb/table.py +1 −1
@@ -505,7 +505,7 @@
505505 Only available with use_tantivy=False
506506 If False, do not store the positions of the terms in the text.
507507 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.
509509
510510 """
511511 raise NotImplementedError
modified python/python/tests/test_fts.py +1 −1
@@ -143,7 +143,7 @@
143143 @pytest.mark.parametrize("with_position", [True, False])
144144 def test_create_inverted_index(table, use_tantivy, with_position):
145145 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")
147147 table.create_fts_index("text", use_tantivy=use_tantivy, with_position=with_position)
148148
149149