Skip to Content

Interface SearchOptions

What MemoryOperations.search takes beyond the query itself.

Name a domain or a session — never neither. A search that names neither is refused before anything is sent, because the request has no other way to say which domain to look in. Naming a session runs the search in that session's domain and records it beside the other searches made under it; naming a domain alone opens a session for this one search and returns its id on the result. Naming both is allowed, and the service takes the domain from the session.

A tag either narrows the results or boosts them, and which one it does is a property of its type rather than of the search. DomainEntry names the narrowing ones in filterTagTypes, and the distinction matters: a wrong boosting tag only costs ranking, while a wrong filtering tag returns nothing at all. MemoryOperations.listDomains says which tag types each domain uses and how many it accepts. More than that many are trimmed to the cap rather than refused: the service trims too, so raising here would reject a search it would have run. Naming a session and no domain skips the local trim entirely — the client cannot see which domain the session belongs to — and the service applies the cap instead. Naming both still trims against the domain's cap.

interface SearchOptions {
    timeout?: number;
    domain?: string;
    sessionId?: string;
    tags?: Iterable<Tag, any, any>;
}

Hierarchy (View Summary)

Index
timeout?: number

Seconds to wait for this call. Defaults to the client's own timeout.

domain?: string

The domain to search. Pass this or SearchOptions.sessionId.

sessionId?: string

The session to record the search under, which supplies the domain.

tags?: Iterable<Tag, any, any>

Tags to narrow or boost by, depending on each tag's type. Trimmed to the domain's cap rather than refused.