File tree Expand file tree Collapse file tree 4 files changed +26
-12
lines changed
elasticsearch/helpers/vectorstore Expand file tree Collapse file tree 4 files changed +26
-12
lines changed Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ def es_query(
217
217
"num_candidates" : num_candidates ,
218
218
}
219
219
220
- if query_vector :
220
+ if query_vector is not None :
221
221
knn ["query_vector" ] = query_vector
222
222
else :
223
223
# Inference in Elasticsearch. When initializing we make sure to always have
Original file line number Diff line number Diff line change 32
32
33
33
34
34
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.
36
37
Users can pick from available retrieval strategies.
37
38
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.
42
49
"""
43
50
44
51
def __init__ (
Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ def es_query(
217
217
"num_candidates" : num_candidates ,
218
218
}
219
219
220
- if query_vector :
220
+ if query_vector is not None :
221
221
knn ["query_vector" ] = query_vector
222
222
else :
223
223
# Inference in Elasticsearch. When initializing we make sure to always have
Original file line number Diff line number Diff line change 30
30
31
31
32
32
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.
34
35
Users can pick from available retrieval strategies.
35
36
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.
40
47
"""
41
48
42
49
def __init__ (
You can’t perform that action at this time.
0 commit comments