Home Reference Source
import {MultiIndexSearch} from '~/models/Search.js'
public class | source

MultiIndexSearch

A group of categories. This supports formatting for most types

Constructor Summary

Public Constructor
public

constructor(search: Search, query: string, indices: string[], opts: Object, perPage: number)

Member Summary

Public Members
public get

If they are more.

public

Method Summary

Public Methods
public

Will start at the page as incremented by next().

public

formatResults(response: Object)

Formats a batch result

public

async getPage(pageNumber: number): SearchResults

Gets the nth page

public

async next(): SearchResults

Obtains the next page

Public Constructors

public constructor(search: Search, query: string, indices: string[], opts: Object, perPage: number) source

Params:

NameTypeAttributeDescription
search Search

The search object

query string

Query

indices string[]

Names of indices to iterate over

opts Object

The options

perPage number
  • optional
  • default: 20

Amount to load per page

Public Members

public get areMore: boolean source

If they are more.

Public Methods

public [Symbol.iterator](): SearchResults source

Will start at the page as incremented by next().

Return:

SearchResults

public formatResults(response: Object) source

Formats a batch result

Params:

NameTypeAttributeDescription
response Object

public async getPage(pageNumber: number): SearchResults source

Gets the nth page

Params:

NameTypeAttributeDescription
pageNumber number

Return:

SearchResults

public async next(): SearchResults source

Obtains the next page

Return:

SearchResults (nullable: true)