IndexDefinition

class IndexDefinition(val path: CatalogPath, val kind: IndexKind = IndexKind.INVERTED, val fields: List<CatalogPath> = emptyList())

What an index is over.

A path and a kind, and nothing else — no name, no options, no build state. Everything else about an index is either derived from the segments (its coverage) or assigned when it is created (its id), and putting any of it here would make two definitions of the same thing unequal.

The path is a CatalogPath rather than a VariantPath because that is the vocabulary the recommendation arrives in, and because it is the one that can describe an array: $.tags[*] indexes every element of tags, which is what a query asking "which documents are tagged x" means. A VariantPath names one location and cannot say that.

Constructors

Link copied to clipboard
constructor(path: CatalogPath, kind: IndexKind = IndexKind.INVERTED, fields: List<CatalogPath> = emptyList())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

For IndexKind.COMPOSITE_TERM, the fields keyed together — relative to the element at path, and empty for every other kind.

Link copied to clipboard

What kind of index.

Link copied to clipboard

The path indexed. Array indices collapse to [*]; see CatalogPath.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String