Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace Search

The Search aptitude provides access to search.

Index

Type aliases

Config

Config: { beginsWithSearch?: undefined | false | true; exactMatchThreshold?: undefined | number; searchSize?: undefined | number; sortBy?: string[] }

Type declaration

  • Optional beginsWithSearch?: undefined | false | true
  • Optional exactMatchThreshold?: undefined | number
  • Optional searchSize?: undefined | number
  • Optional sortBy?: string[]

Document

Document: { data: string; fields?: Array<Field>; name: string }

Type declaration

  • data: string
  • Optional fields?: Array<Field>
  • name: string

Field

Field: { displayName?: undefined | string; name: string; type?: FieldType }

Type declaration

  • Optional displayName?: undefined | string
  • name: string
  • Optional type?: FieldType

FieldType

FieldType: "standard" | "stemmer" | "simple" | "numeric" | "boolean" | "datetime"

Methods

createIndex

  • Creates a Search index with the provided configuration and data.

    Parameters

    • name: string
    • documents: Array<Document>
    • config: Config

      The configuration object defines how the index will preform certain searches

    Returns Promise<Index>

    A Promise resolving with the an Index object.

exists

  • exists(name: string): Promise<boolean>
  • Verifies a search index exists with the provided name.

    Parameters

    • name: string

      The unique name of the Search Index.

    Returns Promise<boolean>

    returns true if the index exists with the specified name

openIndex

  • openIndex(name: string, config: Config): Promise<Index>
  • Opens an existing search index with the provided configuration.

    Parameters

    • name: string
    • config: Config

      The configuration object defines how the index will preform certain searches

    Returns Promise<Index>

    A Promise resolving with the an Index object.

Generated using TypeDoc