query: query dsl

View source: R/query.R

queryR Documentation

query dsl

Description

query dsl

Usage

query(.data = list(), ...)

query_(.data = list(), ..., .dots)

Arguments

.data

An index object. If nothing passed defaults to all indices, equivalent to doing e.g., localhost:9200/_search

...

Further args passed on

.dots

Explanation...

Details

The DSL for elastic makes it easy to do queries against an Elasticsearch instance, either local or remote.

The workflow with the DSL:

  1. Start with the index to use, e.g., index("shakespeare")

  2. Define queries, e.g., range(speech_number == 5, line_id > 3)

  3. Execute search, e.g., Search()

Alternatively, if nothing follows a query definition, Search is called to execute the search with the query as given. In a sense, this is essentially like what dplyr does.

Examples

## Not run: 
elastic::connect(errors = "complete")

index("shakespeare") %>% query("prefix", speaker = "we")

## End(Not run)

ropensci/elasticdsl documentation built on May 18, 2022, 9:53 a.m.