Skip to content

Index Design

Choose indexes from the application’s filters, ordering and paging requirements. Use the operator reference for constructor details and index query examples for filters and spatial candidates.

Access patternIndex familyTypical operators
Sort, exact lookup, prefix/range scan, ordered pagingOrderedProperty reference, Multiple, Reversed, Normalize
Search terms across a named set of fieldsSearchAnyOf, Split, Normalize

Compose an ordered tuple in the same leading-field order as the query. Scalar indexes normally produce one key per record; collection indexes can fan out.

Search indexes emit terms. Query the named surface with Matches, MatchesPrefix or MatchesRegEx. They do not provide the application’s record sort order.

A catalog can need both ordered browsing and token search over the same fields. Define both when the access patterns require them; normalization alone is not tokenization.

Use surname.ref() for the stored value. See Reference.

Transform a value before comparison or tokenization. See Normalize.

Reverse one component’s order. See Reversed.

Use max-oriented positioning for a reference component. See ReferenceToMax.

Compose ordered components; leading parts determine useful lookup ranges. See Multiple.

Emit terms with Whitespace or WordBoundary boundaries. See Split.

Combine fields belonging to one search surface. See AnyOf.

Multiple(Normalize(surname.ref()), firstName.ref(), Reversed(createdAt.ref()))

Compare normalized surname, then first name, then descending creation time.

AnyOf("name", surname.ref(), firstName.ref(), fullName.ref())
.normalize().split(WordBoundary)

Normalize and tokenize each child field under the name surface.

Transforms on AnyOf apply to each child; they do not concatenate fields first. See equivalent forms.

Use property filters and order clauses. See ordered queries.

Use the named search filters. See search queries.

GeoHash narrows candidates for exact box/radius filters; it does not sort by distance. See spatial candidates.

Use separate ordered and search indexes when both browsing and token search are required.

Group related name parts, addresses or aliases into their own user-facing surfaces.

Normalization changes comparison values; adding Split changes term boundaries.

Whitespace separates whitespace; WordBoundary also handles hyphen-like boundaries.

Write regexes for transformed search terms

Section titled “Write regexes for transformed search terms”

Target emitted, normalized terms rather than the original stored string.