SearchServerArgs
Defined in: packages/core/src/api/search/server.ts:37
Server-side args for search.
Inherits ctx, populate, depth, and config (with mutual-exclusion
constraints) from GenericQueryServerParams.
Extends
Section titled “Extends”GenericQueryServerParams<DataModel,TCollectionSlug,TPopulate,D>
Type Parameters
Section titled “Type Parameters”DataModel
Section titled “DataModel”DataModel extends GenericDataModel
The Convex data model (inferred from ctx).
TCollectionSlug
Section titled “TCollectionSlug”TCollectionSlug extends CollectionSlug
Collection slug.
TPopulate
Section titled “TPopulate”TPopulate extends PopulateShape<TCollectionSlug>
Populate object.
D extends number = 0
Depth literal (0 = no depth, default).
Properties
Section titled “Properties”access?
Section titled “access?”
optionalaccess?:AccessCallOptions<QueryCallAction>
Defined in: packages/core/src/api/types.ts:216
Per-call access overrides.
Inherited from
Section titled “Inherited from”GenericQueryServerParams.access
optionalauth?:VexApiAuth
Defined in: packages/core/src/api/types.ts:223
The auth config of the current user making the query.
Example
Section titled “Example”{ user: {...}, organization: {...} }Inherited from
Section titled “Inherited from”collection
Section titled “collection”collection:
TCollectionSlug
Defined in: packages/core/src/api/search/server.ts:44
The collection to search — must match a registered collection slug.
config?
Section titled “config?”
optionalconfig?: [TPopulate] extends [Record<string,never>] ?VexConfig:never
Defined in: packages/core/src/api/types.ts:241
The resolved VexConfig. Required alongside depth; passed
from the queryApi factory closure so the Convex handler has schema info.
Inherited from
Section titled “Inherited from”GenericQueryServerParams.config
ctx:
GenericQueryCtx<DataModel>
Defined in: packages/core/src/api/types.ts:225
Discriminator: server args MUST supply a Convex query context.
Inherited from
Section titled “Inherited from”depth?
Section titled “depth?”
optionaldepth?: [TPopulate] extends [Record<string,never>] ?D:never
Defined in: packages/core/src/api/types.ts:236
Auto-populate all relationship fields to this many levels.
Becomes never when TPopulate is non-empty. Use populate for
consumer-facing code; this is an internal escape hatch for CollectionListView.
Inherited from
Section titled “Inherited from”GenericQueryServerParams.depth
filter?
Section titled “filter?”
optionalfilter?: (q) =>ExpressionOrValue<boolean>
Defined in: packages/core/src/api/search/server.ts:73
Filter predicate applied after index narrowing. Equivalent to
.filter(q => q.eq(q.field("published"), true)) on the Convex query.
Prefer withIndex for performance — filter scans every document
in the range and is O(n). Use filter for secondary conditions that
can’t be expressed as index equality ranges.
Parameters
Section titled “Parameters”FilterBuilder<NamedTableInfo<DataModel, TCollectionSlug extends TableNamesInDataModel<DataModel> ? TCollectionSlug : never>>
Returns
Section titled “Returns”ExpressionOrValue<boolean>
Example
Section titled “Example”find({ ctx, collection: "posts", filter: q => q.eq(q.field("published"), true) })limit?
Section titled “limit?”
optionallimit?:number
Defined in: packages/core/src/api/search/server.ts:52
Maximum number of results. Defaults to 20.
paginationOpts?
Section titled “paginationOpts?”
optionalpaginationOpts?:PaginationOptions
Defined in: packages/core/src/api/search/server.ts:59
Pagination options. When provided, the function returns a PaginationResult
with { page, continueCursor, isDone } instead of a plain array.
Uses Convex’s native .paginate(opts) API under the hood.
populate?
Section titled “populate?”
optionalpopulate?: [D] extends [0] ?TPopulate:never
Defined in: packages/core/src/api/types.ts:230
Recursive populate object, type-narrowed against RelationshipKeysOf<TCollectionSlug>.
Mutually exclusive with depth — becomes never when D ≠ 0.
Inherited from
Section titled “Inherited from”GenericQueryServerParams.populate
query:
string
Defined in: packages/core/src/api/search/server.ts:46
The search text. Pass "" to list recent documents (falls back to .take()).
searchField
Section titled “searchField”searchField:
string
Defined in: packages/core/src/api/search/server.ts:50
The field the search index is built on. Must match searchField in the index declaration.
searchIndexName
Section titled “searchIndexName”searchIndexName:
string
Defined in: packages/core/src/api/search/server.ts:48
The .searchIndex() name declared in the Convex schema (e.g. "search_name").