You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
836 B
27 lines
836 B
6 years ago
|
#' Generate a query string query for ElasticSearch
|
||
|
#'
|
||
|
#' Generate a query string query for ElasticSearch
|
||
|
#' @param x Query string in ElasticSearch query string format
|
||
|
#' @return A formatted ElasticSearch query string query
|
||
|
#' @export
|
||
|
#' @examples
|
||
|
#' query_string(x)
|
||
|
#################################################################################################
|
||
|
#################################### Get data from ElasticSearch ################################
|
||
|
#################################################################################################
|
||
|
|
||
|
query_string <- function(x) {
|
||
|
return(paste0(
|
||
|
'{
|
||
|
"query": {
|
||
|
"query_string" : {
|
||
|
"default_field" : "text",
|
||
|
"query" : "',x,'",
|
||
|
"default_operator": "AND",
|
||
|
"allow_leading_wildcard" : false
|
||
|
}
|
||
|
}
|
||
|
}'
|
||
|
))
|
||
|
}
|