parent
d203de0b2a
commit
db418d7396
@ -0,0 +1,26 @@
|
||||
#' 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
|
||||
}
|
||||
}
|
||||
}'
|
||||
))
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/query_string.R
|
||||
\name{query_string}
|
||||
\alias{query_string}
|
||||
\title{Generate a query string query for ElasticSearch}
|
||||
\usage{
|
||||
query_string(x)
|
||||
}
|
||||
\arguments{
|
||||
\item{x}{Query string in ElasticSearch query string format}
|
||||
}
|
||||
\value{
|
||||
A formatted ElasticSearch query string query
|
||||
}
|
||||
\description{
|
||||
Generate a query string query for ElasticSearch
|
||||
}
|
||||
\examples{
|
||||
query_string(x)
|
||||
}
|
Loading…
Reference in new issue