mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-12-13 15:57:24 +00:00
test: add meta fields for meta_config to be used during testing (#3021)
* added meta fields for meta_config to be used during realtime testing of PineconeDocumentStore * Add documentation on metadata filtering in docstring * docs Co-authored-by: Sara Zan <sara.zanzottera@deepset.ai>
This commit is contained in:
parent
81a5949103
commit
26c938a8e6
@ -4744,6 +4744,7 @@ lost if you choose to recreate the index. Be aware that both the document_index
|
||||
be recreated.
|
||||
- `metadata_config`: Which metadata fields should be indexed. Should be in the format
|
||||
`{"indexed": ["metadata-field-1", "metadata-field-2", "metadata-field-n"]}`.
|
||||
Indexing metadata fields is a prerequisite to allow filtering of documents by metadata values.
|
||||
- `validate_index_sync`: Whether to check that the document count equals the embedding count at initialization time
|
||||
|
||||
<a id="pinecone.PineconeDocumentStore.write_documents"></a>
|
||||
|
||||
@ -89,6 +89,7 @@ class PineconeDocumentStore(SQLDocumentStore):
|
||||
be recreated.
|
||||
:param metadata_config: Which metadata fields should be indexed. Should be in the format
|
||||
`{"indexed": ["metadata-field-1", "metadata-field-2", "metadata-field-n"]}`.
|
||||
Indexing metadata fields is a prerequisite to allow filtering of documents by metadata values.
|
||||
:param validate_index_sync: Whether to check that the document count equals the embedding count at initialization time
|
||||
"""
|
||||
# Connect to Pinecone server using python client binding
|
||||
|
||||
@ -87,6 +87,20 @@ DC_TEST_INDEX = "document_retrieval_1"
|
||||
DC_API_KEY = "NO_KEY"
|
||||
MOCK_DC = True
|
||||
|
||||
# Set metadata fields used during testing for PineconeDocumentStore meta_config
|
||||
META_FIELDS = [
|
||||
"meta_field",
|
||||
"name",
|
||||
"date_field",
|
||||
"numeric_field",
|
||||
"f1",
|
||||
"f3",
|
||||
"meta_id",
|
||||
"meta_field_for_count",
|
||||
"meta_key_1",
|
||||
"meta_key_2",
|
||||
]
|
||||
|
||||
# Disable telemetry reports when running tests
|
||||
posthog.disabled = True
|
||||
|
||||
@ -979,6 +993,7 @@ def get_document_store(
|
||||
index=index,
|
||||
similarity=similarity,
|
||||
recreate_index=recreate_index,
|
||||
metadata_config={"indexed": META_FIELDS},
|
||||
)
|
||||
|
||||
else:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user