Interface: QueryOptions
Optional parameters forMossClient.query().
Properties
Filter shape
Thefilter value is a dict with either a field condition or a logical
composition:
$eq, $ne, $gt, $gte, $lt, $lte,
$in, $nin, $near.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
MossClient.query().
| Property | Type | Description |
|---|---|---|
embedding | Optional[Sequence[float]] | Caller-provided query embedding. When supplied, the service/client skips embedding generation. |
top_k | Optional[int] | Number of top results to return. |
alpha | Optional[float] | Weight for hybrid search fusion. 1.0 = pure semantic, 0.0 = pure keyword. Default 0.8. |
filter | Optional[dict] | Metadata filter applied to the query. Honored on locally loaded indexes; load the index (or open a session) before querying with a filter. |
group_by | Optional[ParentGrouping] | Collapse sibling hits sharing a parent id into one result per unit. See ParentGrouping and Exact / Graph Retrieval. (moss 1.6.0+) |
filter value is a dict with either a field condition or a logical
composition:
# Field condition
{"field": "city", "condition": {"$eq": "NYC"}}
# Logical composition
{"$and": [filter_a, filter_b, ...]}
{"$or": [filter_a, filter_b, ...]}
$eq, $ne, $gt, $gte, $lt, $lte,
$in, $nin, $near.
from moss import QueryOptions
options = QueryOptions(
top_k=5,
alpha=0.6,
filter={
"$and": [
{"field": "category", "condition": {"$eq": "shoes"}},
{"field": "price", "condition": {"$lt": 100}},
],
},
)