QuerySpec: QuerySpec Class

QuerySpecR Documentation

QuerySpec Class

Description

For more information on the NBA object model, please refer to the official NBA documentation at https://docs.biodiversitydata.nl and the NBA model and endpoints reference at https://docs.biodiversitydata.nl/endpoints-reference.

Usage

# QuerySpec$new()

Format

R6 class

Details

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.

Fields

constantScore

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.

fields

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.

conditions

list(QueryCondition) List of QueryCondition objetcs

logicalOperator

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

sortFields

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

from

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

size

integer The number of documents to return.

Methods

$new()

Constructor QuerySpec object.

$fromList(QuerySpecList)

Create QuerySpec object from list.

$toList()

Get list representation of QuerySpec.

fromJSONString(QuerySpecJson)

Create QuerySpec object from JSON.

toJSONString(pretty=TRUE)

Get JSON representation of QuerySpec.


naturalis/nbaR documentation built on Nov. 12, 2023, 4:47 p.m.