Class: QueryField

QueryField()

A QueryField is one of the 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 QueryField()

Since:
  • 2.14.0
Source:

Extends

  • Backbone.Model

Methods

aliases() → {object}

aliases - Returns a map that matches query field names (key) to a more human readable alias (value).
Source:
Returns:
A map of field names as keys and aliases (string) as values.
Type
object

categoriesMap() → {Array.<CategoryMap>}

categoriesMap - Returns an array of objects that can be used to add a general category and icon to a query field model. Each object in the array comprises a label (string)
Source:
Returns:
Returns an array of objects that define how to categorize fields.
Type
Array.<CategoryMap>

defaults() → {object}

Overrides the default Backbone.Model.defaults() function to specify default attributes for the query fields model
Source:
Returns:
Type
object

descriptions() → {object}

descriptions - Returns a map that matches query field names (key) to a more understandable description to use for the field.
Source:
Returns:
A map of field names as keys and descriptions (string) as values.
Type
object

filterTypesMap() → {object}

filterTypesMap - Returns a map that matches every type of query field available in the index to the appropriate filter to use
Source:
Returns:
Returns an object where the keys are the nodenames of the filters to use and the values are an array of the associated query types. The query types in the array must exactly match the query types in the type attribute of a query field model.
Type
object

getCategory() → {object}

getCategory - Finds the matching category for this field based on the categoriesMap. The function will first check for a matching field name, and if not found, will match by field type.
Source:
Returns:
returns an object with an icon and category property (both strings)
Type
object

getFilterType() → {string}

getFilterType - Searches the filterTypesMap and returns the filter type that is required for this query field
Source:
Returns:
The nodeName of the filter that should be used for this query field
Type
string

getReadableName() → {string}

getReadableName - Creates and returns a more human-friendly label for the field
Source:
Returns:
A humanized alias for the field
Type
string

initialize()

initialize - When a new query field is created, set the label, category, and filterType attributes
Source:

isType(type) → {boolean}

isType - Checks if this field is a certian type
Parameters:
Name Type Description
type string the solr field type
Source:
Returns:
returns true of the field exactly matches
Type
boolean

save() → {boolean}

Overwrites the Backbone save function because query fields are read only
Source:
Returns:
always returns false
Type
boolean