common: common dsl

View source: R/common.R

commonR Documentation

common dsl

Description

common dsl

Usage

common(
  .obj = list(),
  field,
  query = NULL,
  cutoff_frequency = NULL,
  low_freq_operator = NULL,
  minimum_should_match = NULL
)

common_(
  .obj = list(),
  field,
  query = NULL,
  cutoff_frequency = NULL,
  low_freq_operator = NULL,
  minimum_should_match = NULL
)

Arguments

.obj

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

field

Explanation...

query

Explanation...

cutoff_frequency

Explanation...

low_freq_operator

Explanation...

minimum_should_match

Explanation...

Examples

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

# common query - not working yet
# index("shakespeare") %>% common( speech_number <= 5 )

## common query without DSL
x <- '{
  "query": {
    "query_string" : {
      "default_field" : "text_entry",
      "query" : "this AND that OR thus"
    }
  }
}'
Search("shakespeare", body = body)

body <- '{
 "query" : {
   "common": {
      "body": {
           "query": "against"
       }
     }
  }
}'
elastic::Search('shakespeare', body=body)

## End(Not run)

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