Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Query

Index

Constructors

constructor

  • new Query(queryString: string): Query

Properties

Private _fields

_fields: string[] = []

Private _filters

_filters: Filter[] = []

Private _ids

_ids: (string | number)[] = []

Private _inOrder

_inOrder: boolean = false

_noContent

_noContent: boolean = false

Private _noStopwords

_noStopwords: boolean = false

Private _num

_num: number = 10

Private _offset

_offset: number = 0

Private _queryString

_queryString: string

Private _returnFields

_returnFields: string[] = []

Private _slop

_slop: number = -1

Private _sortby

_sortby: SortbyField

Private _verbatim

_verbatim: boolean = false

_withPayloads

_withPayloads: boolean = false

Accessors

args

args:

Format the redis arguments for this query and return them

queryString

queryString:

Return the query string of this query only

Methods

addFilter

  • addFilter(filter: Filter): this
  • Add a numeric or geo filter to the query. Currently only one of each filter is supported by the engine

    Parameters

    Returns this

inOrder

  • inOrder(): this
  • Match only documents where the query terms appear in the same order in the document. i.e. for the query 'hello world', we do not match 'world hello'

    Returns this

limitFields

  • limitFields(fields: string[]): this
  • Limit the search to specific TEXT fields only

    Parameters

    • fields: string[]

      A list of strings, case sensitive field names from the defined schema

    Returns this

limitIds

  • limitIds(ids: string[]): this
  • Limit the results to a specific set of pre-known document ids of any length

    Parameters

    • ids: string[]

    Returns this

noContent

  • noContent(): this
  • Set the query to only return ids and not the document content

    Returns this

noStopwords

  • noStopwords(): this
  • Prevent the query from being filtered for stopwords. Only useful in very big queries that you are certain contain no stopwords.

    Returns this

paging

  • paging(offset: number, num: number): this
  • Set the paging for the query (defaults to 0..10).

    Parameters

    • offset: number

      Paging offset for the results. Defaults to 0

    • num: number

      How many results do we want

    Returns this

returnFields

  • returnFields(fields: string[]): this
  • Only return values from these fields

    Parameters

    • fields: string[]

    Returns this

slop

  • slop(slop: number): this
  • Allow a maximum of N intervening non matched terms between phrase terms (0 means exact phrase)

    Parameters

    • slop: number

    Returns this

sortBy

  • sortBy(field: string, asc?: boolean): this
  • Add a sortby field to the query

    Parameters

    • field: string

      the name of the field to sort by

    • Default value asc: boolean = true

      when true, sorting will be done in ascending order

    Returns this

verbatim

  • verbatim(): this
  • Set the query to be verbatim, i.e. use no query expansion or stemming

    Returns this

withPayload

  • withPayload(): this
  • Ask the engine to return document payloads

    Returns this

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc