Skip to content

resolveTitleSearchIndex

resolveTitleSearchIndex(props): ResolvedTitleSearchIndex | undefined

Defined in: packages/core/src/collections/validator.ts:108

Resolves the search index backing a collection’s useAsTitle field, for use by both schema generation (collectionConfigToVexSchema) and the admin picker (usePaginatedSearch), so the two agree on a single name.

useAsTitle is searchable only when it names a field declaring its own searchIndex support ("searchIndex" in field — text, textarea, email). When that field configures its own searchIndex (any name), that index is reused as-is. Otherwise the field is searchable but has no manual index, so the auto-generated search_<useAsTitle> name is returned. A useAsTitle pointing at a Convex system field (_id, _creationTime) or at a non-searchable field type (number, date, …) returns undefined — the picker falls back to find().

Input props.

CollectionConfig

The collection whose useAsTitle is resolved.

ResolvedTitleSearchIndex | undefined

The index name + search field to query, or undefined when useAsTitle has no backing search index.