validate: Validate a search

Description Usage Arguments See Also Examples

View source: R/validate.R

Description

Validate a search

Usage

1

Arguments

index

Index name. Required.

type

Document type. Optional.

...

Additional args passed on to Search()

See Also

Search()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## Not run: 
if (!index_exists("twitter")) index_create("twitter")
docs_create('twitter', type='tweet', id=1, body = list(
   "user" = "foobar", 
   "post_date" = "2014-01-03",
   "message" = "trying out Elasticsearch"
 )
)
validate("twitter", q='user:foobar')
validate("twitter", "tweet", q='user:foobar')

body <- '{
"query" : {
  "bool" : {
    "must" : {
      "query_string" : {
        "query" : "*:*"
      }
    },
    "filter" : {
      "term" : { "user" : "kimchy" }
    }
  }
}
}'
validate("twitter", body = body)

## End(Not run)

ropensci/elastic documentation built on Dec. 17, 2018, 11:08 a.m.