For more information on the NBA object model, please refer to the official NBA documentation at and the NBA model and endpoints reference at

# QuerySpec$new()


R6 class


Model class for QuerySpec objects. A QuerySpec object enables you to specify a query for the NBA. It contains the following properties, each covering a different aspect of the query: * conditions: The search criteria a.k.a. query conditions. Only documents that satisfy all search criteria or at least one (depending on the logicalOperator are returned.



logical If true, no relevance scores will be calculated for the returned documents. By default Elasticsearch not only determines whether a document matches your search criteria, but also how well it matches them, expressed as a so-called relevance score. If you are not interested in relevance scores, set constantScore to true, as there is some performance overhead associated with calculating relevance scores.


list(character) The fields to be returned. Specimen, Taxon and MultiMediaObject documents are large documents containing lots of fields. If you are only interested in a few fields, use the fields property to specify them.


list(QueryCondition) List of QueryCondition objetcs


character (AND/OR) Specifies whether a document must satisfy all search criteria or just one in order to be returned.


list(SortField) Specifies the field(s) on which to sort the documents.


integer The offset in the result set from which to return the documents.


integer The number of documents to return.



Constructor QuerySpec object.


Create QuerySpec object from list.


Get list representation of QuerySpec.


Create QuerySpec object from JSON.


Get JSON representation of QuerySpec.