Get Metadata Facets
Get metadata facets
POST
ApiKeyAuthheader
AuthorizationBearer <token>Api key to access Mixedbreads API
application/json- body
The parameters for getting metadata facets
store_identifiers*array<string|>IDs or names of stores
Items
1 <= items <= 64filters?||array<|>|Optional filter conditions
file_ids?array<any>|array<>|Optional list of file IDs to filter chunks by (inclusion filter)
query?|Search query text
top_k?Top KNumber of results to return
Range
1 <= value <= 10000Default
10search_options?Search configuration options
facets?array<string>|Optional list of facets to return. Use dot for nested fields.
max_fields?Max FieldsMaximum number of distinct metadata fields (keys) to return.
Range
1 <= value <= 256Default
64max_values_per_field?Max Values Per FieldMaximum number of distinct values returned per field, ranked by count.
Range
1 <= value <= 256Default
32max_files?Max FilesMaximum number of store files scanned to compute facets.
Range
1 <= value <= 100000Default
10000The metadata facets
application/json- response
Represents metadata facets for a store.
facets*Metadata facets
from mixedbread import Mixedbread
mxbai = Mixedbread(api_key="YOUR_API_KEY")
response = mxbai.stores.metadata_facets(
store_identifiers=["my-knowledge-base"],
facets=["author", "year"],
)
print(response.facets)
Example Response
{
"facets": {
"category": {
"report": 3,
"press": 2
},
"year": {
"2022": 1,
"2023": 2,
"2024": 2
},
"author.name": {
"alice": 2,
"bob": 1,
"carol": 2
}
}
}