Class: QueryFields

QueryFields()

The collection of queryable fields supported by the the DataONE Solr index, as provided by the DataONE API CNRead.getQueryEngineDescription() function. For more information, see: https://indexer-documentation.readthedocs.io/en/latest/generated/solr_schema.html https://dataone-architecture-documentation.readthedocs.io/en/latest/design/SearchMetadata.html

Constructor

new QueryFields()

Since:
  • 2.14.0
Source:

Extends

  • Backbone.Collection

Members

model

The type of Backbone model that this collection comprises
Source:

Methods

comparator(model) → {number}

comparator - A sortBy function that returns the order of each Query Filter model based on its position in the categoriesMap object.
Parameters:
Name Type Description
model QueryFilter The individual Query Filter model
Source:
Returns:
A numeric value by which the model should be ordered relative to others.
Type
number

fetch()

Retrieve the fields from the Coordinating Node
Source:

getRequiredFilterType(fields) → {string}

getRequiredFilterType - Based on an array of query (Solr) field names, get the type of filter model to use with these fields. For example, if the fields are type text, use a regular filter model. If the fields are tdate, use a dateFilter. If the field types are mixed, then returns the filterType default value in QueryField models.
Parameters:
Name Type Description
fields Array.<string> The list of Query Field names
Source:
Returns:
The nodeName of the filter model to use (one of the four types of fields that are set in QueryField#filterTypesMap)
Type
string

initialize()

initialize - Creates a new QueryFields collection
Source:

parse(response) → {Array}

parse - Parse the XML response from the CN
Parameters:
Name Type Description
response string The queryEngineDescription XML as a string
Source:
Returns:
the Array of Query Field attributes to be added to the collection.
Type
Array

url() → {string}

The constructed URL of the collection
Source:
Returns:
- The URL to use during fetch
Type
string