Home > doofinder > Query

Query class

Allows creating a search query programmatically instead of creating the JSON and parameters by hand.

Signature:

export declare class Query 

Constructors

Constructor Modifiers Description
(constructor)(params)   Constructor.

Properties

Property Modifiers Type Description
defaults   QueryParams Get / set the default parameters set when the query is reset.
excludes   QueryFilter Return the instance of the query excludes manager for the current query.
filters   QueryFilter Return the instance of the query filters manager for the current query.
hashid   string Get / set the hashid parameter.
indices   QueryIndices Return the instance of the query indices manager for the current query.
page   number Get / set the page parameter.
queryName   string Get / set the query_name parameter.
rpp   number Get / set the rpp parameter.
sort   QuerySort Return the instance of the sort manager for the current query.
text   string Get / set the query parameter.

Methods

Method Modifiers Description
copy()   Create a copy of the current query.
dump(validate)   Export the query as a params object.
getParam(name)   Retrieve the value of a given parameter.
load(params)   Configure the query with the provided params.
reset()   Reset the current query to the defaults.
setParam(name, value)   Set the value of a given parameter.