Search the Pangaea database with Elasticsearch

pg_search_es(query = NULL, size = 10, from = NULL, source = NULL,
  df = NULL, analyzer = NULL, default_operator = NULL,
  explain = NULL, sort = NULL, track_scores = NULL, timeout = NULL,
  terminate_after = NULL, search_type = NULL,
  lowercase_expanded_terms = NULL, analyze_wildcard = NULL,
  version = FALSE, ...)



(character) Query terms..


(character) The number of hits to return. Pass in as a character string to avoid problems with large number conversion to scientific notation. Default: 10. The default maximum is 10,000 - however, you can change this default maximum by changing the index.max_result_window index level parameter.


(character) The starting from index of the hits to return. Pass in as a character string to avoid problems with large number conversion to scientific notation. Default: 0


(character) character vector of fields to return


(character) The default field to use when no field prefix is defined within the query.


(character) The analyzer name to be used when analyzing the query string.


(character) The default operator to be used, can be AND or OR. Default: OR


(logical) For each hit, contain an explanation of how scoring of the hits was computed. Default: FALSE


(character) Sorting to perform. Can either be in the form of fieldName, or fieldName:asc/fieldName:desc. The fieldName can either be an actual field within the document, or the special _score name to indicate sorting based on scores. There can be several sort parameters (order is important).


(logical) When sorting, set to TRUE in order to still track scores and return them as part of each hit.


(numeric) A search timeout, bounding the search request to be executed within the specified time value and bail with the hits accumulated up to that point when expired. Default: no timeout.


(numeric) The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. If set, the response will have a boolean field terminated_early to indicate whether the query execution has actually terminated_early. Default: no terminate_after


(character) The type of the search operation to perform. Can be query_then_fetch (default) or dfs_query_then_fetch. Types scan and count are deprecated. See for more details on the different types of search that can be performed.


(logical) Should terms be automatically lowercased or not. Default: TRUE.


(logical) Should wildcard and prefix queries be analyzed or not. Default: FALSE


(logical) Print the document version with each document.


Curl options passed on to crul::HttpClient


tibble/data.frame, empty if no results


An interface to Pangaea's Elasticsearch query interface. You can also just use elastic package to interact with it. The base URL is

See also


if (FALSE) { (res <- pg_search_es()) attributes(res) attr(res, "total") attr(res, "max_score") pg_search_es(query = 'water', source = c('parentURI', 'minElevation')) pg_search_es(query = 'water', size = 3) pg_search_es(query = 'water', size = 3, from = 10) pg_search_es(query = 'water sky', default_operator = "OR") pg_search_es(query = 'water sky', default_operator = "AND") pg_search_es(query = 'water', sort = "minElevation") pg_search_es(query = 'water', sort = "minElevation:desc") }