Detailed information on the in-memory search component
The in-memory search store keeps every index in the memory of the Dapr sidecar. Use it for local development and tests that need no external search service. It is not durable: indexes and documents are lost when the sidecar stops, and they aren’t shared between sidecar instances.
Component format
To set up an in-memory search store, create a component of type search.in-memory. See this guide on how to create and apply a search store configuration.
Queues every write and applies it once this delay has passed, so that you can test queued acknowledgements and wait timeouts. Defaults to "0s", which applies writes before the call returns.
A query with highlightFields returns UNIMPLEMENTED.
Pagination
Y
Continuation tokens are offset based.
Native queries
N
A query with native returns UNIMPLEMENTED.
Queued acknowledgement
Y
Writes return INDEX_ACK_QUEUED when indexingDelay is set, so INDEXING_WAIT_TIMEOUT_ACTION_CONTINUE_ASYNC is supported. Without a delay, writes return INDEX_ACK_COMPLETED.
Wait for completion
Y
With indexingDelay set, the request waits for the queued write, up to waitTimeout.
Scores and total hits
A full-text query searches the searchFields of the query, or every content field when searchFields isn’t set. Matching is case-insensitive, and text is split into words of letters and digits.
A document matches only when every query term occurs in the searched fields. The hit score is the number of times the query terms occur.
Without sort, hits are ordered by score, highest first, then by document ID. With sort, the score and document ID break ties.
totalHits is exact and reported with TOTAL_HITS_RELATION_EXACT.
When topK isn’t set, the component returns up to 10 hits per page.
Detailed information on the Meilisearch search component
Component format
To set up a Meilisearch search store, create a component of type search.meilisearch. See this guide on how to create and apply a search store configuration.
Pass the following Meilisearch index settings as comma-separated values in the metadata of a create index request:
Metadata
Details
Example
filterableAttributes
Content fields that filters can use. Meilisearch rejects filters on fields that aren’t declared here.
"category,price"
sortableAttributes
Content fields that sorts can use. id is always added, because the component uses the document ID as a tie-breaker for stable pagination.
"price,publishedAt"
searchableAttributes
Content fields that full-text queries search, in order of importance. When omitted, all fields are searchable.
"title,body"
The component also moves the sort ranking rule first, so that a query with sort returns hits in the requested order, with relevance breaking ties.
Settings are only applied when an index is created. Creating an index that already exists returns ALREADY_EXISTS and doesn’t change its settings.
Get index returns the following properties: primaryKey (always id), and filterableAttributes, sortableAttributes, and searchableAttributes when set.
Document mapping
The document id is the Meilisearch primary key. It must be 1 to 511 bytes of ASCII letters, digits, hyphens, and underscores.
The keys of the document content are stored as top-level Meilisearch attributes. id, daprMetadata, daprPayload, and keys starting with _ are reserved by the component and can’t be used in content.
The document metadata is stored under the reserved daprMetadata attribute and returned unchanged. A full-text query never searches it.
A document with an invalid id, or whose content uses a reserved key, is reported in failedItems with INVALID_ARGUMENT and isn’t sent to Meilisearch. The rest of the batch is still indexed.
Indexing documents into an index that doesn’t exist fails the request with NOT_FOUND, instead of letting Meilisearch create an index without the component’s settings.
Scores and total hits
Hit scores are Meilisearch’s ranking score, a value between 0 and 1 where higher is more relevant.
totalHits is Meilisearch’s estimated total number of hits, reported with TOTAL_HITS_RELATION_ESTIMATE. When the total reaches the index’s maxTotalHits pagination setting, it is reported with TOTAL_HITS_RELATION_LOWER_BOUND, and results past that limit can’t be paged to.
When topK isn’t set, the component returns up to 20 hits per page.
Native queries
The query.native field of a search request accepts the parameters of the Meilisearch search API, for example q, filter, matchingStrategy, or attributesToCrop. Pagination and sorting use the portable query fields, so a native query must not set offset, limit, page, hitsPerPage, or sort. A native filter is combined with the portable filter using a logical AND, so it can only narrow the results.
Meilisearch processes writes asynchronously as tasks. With INDEXING_MODE_WAIT_FOR_COMPLETION, the component waits for the task to finish by polling the Meilisearch task API with exponential backoff.
When the experimental Meilisearch tasksStreamingRoute feature is enabled and the API key has the tasks.get permission, the component instead shares a single task-change stream for all waiting writes. If the route reports that it is unavailable, the component falls back to polling. The choice is transparent to your application.
A Meilisearch task is atomic: if the task fails, none of the documents in it are indexed, and a request that waits for completion fails with the task’s error. The component therefore checks the documents that Meilisearch would reject before it sends the task, and reports them in failedItems, as described in document mapping.