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

Signed-off-by: BubbleCal <bubble-cal@outlook.com>
This commit is contained in:
BubbleCal
2024-09-11 10:18:29 +08:00
committed by GitHub
parent 622a2922e2
commit 4b79db72bf
5 changed files with 6 additions and 6 deletions

View File

@@ -205,7 +205,7 @@ table.create_fts_index(["text_field"], use_tantivy=True, ordering_field_names=["
## Phrase queries vs. terms queries
!!! warning "Warn"
Lance-based FTS doesn't support queries combining by boolean operators `OR`, `AND`.
Lance-based FTS doesn't support queries using boolean operators `OR`, `AND`.
For full-text search you can specify either a **phrase** query like `"the old man and the sea"`,
or a **terms** search query like `"(Old AND Man) AND Sea"`. For more details on the terms

View File

@@ -872,7 +872,7 @@ describe.each([arrow13, arrow14, arrow15, arrow16, arrow17])(
];
const table = await db.createTable("test", data);
await table.createIndex("text", {
config: Index.fts({ withPositions: false }),
config: Index.fts({ withPosition: false }),
});
const results = await table.search("hello").toArray();

View File

@@ -142,7 +142,7 @@ export interface FtsOptions {
* If set to false, the index will not store the positions of the tokens in the text,
* which will make the index smaller and faster to build, but will not support phrase queries.
*/
withPositions?: boolean;
withPosition?: boolean;
}
export class Index {
@@ -244,7 +244,7 @@ export class Index {
* For now, the full text search index only supports English, and doesn't support phrase search.
*/
static fts(options?: Partial<FtsOptions>) {
return new Index(LanceDbIndex.fts(options?.withPositions));
return new Index(LanceDbIndex.fts(options?.withPosition));
}
/**

View File

@@ -505,7 +505,7 @@ class Table(ABC):
Only available with use_tantivy=False
If False, do not store the positions of the terms in the text.
This can reduce the size of the index and improve indexing speed.
But it will not be possible to use phrase queries.
But it will raise an exception for phrase queries.
"""
raise NotImplementedError

View File

@@ -143,7 +143,7 @@ def test_create_index_with_stemming(tmp_path, table):
@pytest.mark.parametrize("with_position", [True, False])
def test_create_inverted_index(table, use_tantivy, with_position):
if use_tantivy and not with_position:
pytest.skip("we don't support to build tantivy index without position")
pytest.skip("we don't support building a tantivy index without position")
table.create_fts_index("text", use_tantivy=use_tantivy, with_position=with_position)