Class: Search

Search()

Search filters can be either plain text or a filter object with the following options: filterLabel - text that will be displayed in the filter element in the UI label - text that will be displayed in the autocomplete list value - the value that will be included in the query description - a longer text description of the filter value Example: {filterLabel: "Creator", label: "Jared Kibele (16)", value: "Kibele", description: "Search for data creators"}

Constructor

Source:

Extends

  • Backbone.Model

Methods

addFilters(filters)

Parameters:
Name Type Description
filters Filters | Array.<Filter> The collection of filters to add to this model OR an array of Filter models
Source:

defaults()

Properties:
Name Type Description
filters Filters The collection of filters used to build a query, an instance of Filters
Source:

getQuery(filter, options)

Builds the query string to send to the query engine. Goes over each filter specified in this model and adds to the query string. Some filters have special rules on how to format the query, which are built first, then the remaining filters are tacked on to the query string as a basic name:value pair. These "other filters" are specified in the otherFilters variable.
Parameters:
Name Type Description
filter string A single filter to get a query fragment for
options object Additional options for this function
Properties:
Name Type Description
options.forPOST boolean If true, the query will not be url-encoded, for POST requests
Source: