Skip to content

Commit a5dea84

Browse files
committed
improve docstring
1 parent 71ca330 commit a5dea84

File tree

4 files changed

+26
-12
lines changed

4 files changed

+26
-12
lines changed

elasticsearch/helpers/vectorstore/_async/strategies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def es_query(
217217
"num_candidates": num_candidates,
218218
}
219219

220-
if query_vector:
220+
if query_vector is not None:
221221
knn["query_vector"] = query_vector
222222
else:
223223
# Inference in Elasticsearch. When initializing we make sure to always have

elasticsearch/helpers/vectorstore/_async/vectorstore.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,20 @@
3232

3333

3434
class AsyncVectorStore:
35-
"""VectorStore is a higher-level abstraction of indexing and search.
35+
"""
36+
VectorStore is a higher-level abstraction of indexing and search.
3637
Users can pick from available retrieval strategies.
3738
38-
Documents are flat text documents. Depending on the strategy, vector embeddings are
39-
- created by the user beforehand
40-
- created by this AsyncVectorStore class in Python
41-
- created in-stack by inference pipelines.
39+
Documents have up to 3 fields:
40+
- text_field: the text to be indexed and searched.
41+
- metadata: additional information about the document, either schema-free
42+
or defined by the supplied metadata_mappings.
43+
- vector_field (usually not filled by the user): the embedding vector of the text.
44+
45+
Depending on the strategy, vector embeddings are
46+
- created by the user beforehand
47+
- created by this AsyncVectorStore class in Python
48+
- created in-stack by inference pipelines.
4249
"""
4350

4451
def __init__(

elasticsearch/helpers/vectorstore/_sync/strategies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def es_query(
217217
"num_candidates": num_candidates,
218218
}
219219

220-
if query_vector:
220+
if query_vector is not None:
221221
knn["query_vector"] = query_vector
222222
else:
223223
# Inference in Elasticsearch. When initializing we make sure to always have

elasticsearch/helpers/vectorstore/_sync/vectorstore.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,20 @@
3030

3131

3232
class VectorStore:
33-
"""VectorStore is a higher-level abstraction of indexing and search.
33+
"""
34+
VectorStore is a higher-level abstraction of indexing and search.
3435
Users can pick from available retrieval strategies.
3536
36-
Documents are flat text documents. Depending on the strategy, vector embeddings are
37-
- created by the user beforehand
38-
- created by this AsyncVectorStore class in Python
39-
- created in-stack by inference pipelines.
37+
Documents have up to 3 fields:
38+
- text_field: the text to be indexed and searched.
39+
- metadata: additional information about the document, either schema-free
40+
or defined by the supplied metadata_mappings.
41+
- vector_field (usually not filled by the user): the embedding vector of the text.
42+
43+
Depending on the strategy, vector embeddings are
44+
- created by the user beforehand
45+
- created by this AsyncVectorStore class in Python
46+
- created in-stack by inference pipelines.
4047
"""
4148

4249
def __init__(

0 commit comments

Comments
 (0)