InMemoryRecordStorage

In-memory implementation of SearchStorage and WriteStorage that stores records in a map.

This implementation is useful for testing, development, and scenarios where persistence is not required. All data is stored in memory and will be lost when the application stops.

Limitations:

Parameters

defaultNamespace

The default namespace to use when none is specified in method calls. Defaults to "default".

Constructors

Link copied to clipboard
constructor(defaultNamespace: String = "default")

Functions

Link copied to clipboard
open suspend override fun add(documents: List<TextDocument>, namespace: String?): List<String>
Link copied to clipboard
open suspend override fun delete(ids: List<String>, namespace: String?): List<String>
Link copied to clipboard
open suspend override fun get(ids: List<String>, namespace: String?): List<TextDocument>
Link copied to clipboard
Link copied to clipboard
open suspend override fun search(request: SearchRequest, namespace: String?): List<SearchResult<TextDocument>>
Link copied to clipboard
suspend fun size(namespace: String? = null): Int

Returns the number of records in the repository for the specified namespace.

Link copied to clipboard
open suspend override fun update(documents: Map<String, TextDocument>, namespace: String?): List<String>