boosting: boosting dsl

View source: R/boosting.R

boostingR Documentation

boosting dsl

Description

boosting dsl

Usage

boosting(.obj = list(), ..., negative_boost = NULL)

boosting_(.obj = list(), ..., .dots, negative_boost = NULL)

Arguments

.obj

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

...

Further args passed on

negative_boost

Explanation...

.dots

Explanation...

Examples

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

# boosting query
boost <- '{
 "query" : {
  "boosting" : {
      "positive" : {
          "term" : {
              "play_name" : "henry"
          }
      },
      "negative" : {
          "term" : {
              "text_entry" : "thou"
          }
      },
      "negative_boost" : 0.8
    }
 }
}'
elastic::Search(index="shakespeare", body=boost)
index("shakespeare") %>%
 boosting(positive = list(term = list(play_name = "henry")),
   negative_boost = 0.8)
index("shakespeare") %>%
 boosting(positive = list(term = list(play_name = "henry")),
         negative = list(term = list(text_entry = "thou")),
         negative_boost = 0.8)


## End(Not run)

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