Find answers from the community

Updated 4 weeks ago

Metadata

In AzureAISearch, there seems to be able to customize filterable fields using the metadata_fields, but it seems to be hard coded somehow like the "author" and "director", and then the topic field is a defined data type?

Did I missunderstand wrong or if there could be more example to show how to extract and populate these metadata for a list of Documents? Thank you!

metadata_fields = {
"author": "author",
"theme": ("topic", MetadataIndexFieldType.STRING),
"director": "director",
}

Creating an Azure AI Search Vector Store

vector_store = AzureAISearchVectorStore(
search_or_index_client=index_client,
filterable_metadata_field_keys=metadata_fields,
hidden_field_keys=["embedding"],
index_name=index_name,
index_management=IndexManagement.CREATE_IF_NOT_EXISTS,
id_field_key="id",
chunk_field_key="chunk",
embedding_field_key="embedding",
embedding_dimensionality=1536,
metadata_string_field_key="metadata",
doc_id_field_key="doc_id",
language_analyzer="en.lucene",
vector_algorithm_type="exhaustiveKnn",
semantic_configuration_name="mySemanticConfig",
)

https://docs.llamaindex.ai/en/stable/api_reference/storage/vector_store/azureaisearch/
L
1 comment
Azure requires these to be defined upfront (its very annoying)

You should check your document.metadata fields for what you want to make searchable. Normally, you define the most useful fields in your document metadata anyways, so you should know them already
Add a reply
Sign up and join the conversation on Discord