Search for items within a namespace prefix.
Basic filtering:
# Search for documents with specific metadata
results = store.search(
("docs",),
filter={"type": "article", "status": "published"}
)
Natural language search (requires vector store implementation):
# Initialize store with embedding configuration
store = YourStore( # e.g., InMemoryStore, AsyncPostgresStore
index={
"dims": 1536, # embedding dimensions
"embed": your_embedding_function, # function to create embeddings
"fields": ["text"] # fields to embed. Defaults to ["$"]
}
)
# Search for semantically similar documents
results = store.search(
("docs",),
query="machine learning applications in healthcare",
filter={"type": "research_paper"},
limit=5
)
Natural language search support depends on your store implementation and requires proper embedding configuration.
Key-value pairs to filter results.
Maximum number of items to return.
Number of items to skip before returning results.
Whether to refresh TTLs for the returned items. If no TTL is specified, this argument is ignored.