count: Get counts of the number of records per index.

Description Usage Arguments Details Examples

View source: R/count.r

Description

Get counts of the number of records per index.

Usage

1
2
count(index = NULL, type = NULL, callopts = list(), verbose = TRUE,
  ...)

Arguments

index

Index, defaults to all indices

type

Document type

callopts

Curl args passed on to httr::GET.

verbose

If TRUE (default) the url call used printed to console.

...

Further args passed on to elastic search HTTP API as parameters.

Details

See docs for the count API here https://www.elastic.co/guide/en/elasticsearch/reference/current/search-count.html

You can also get a count of documents using Search() or Search_uri() and setting size = 0

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
count()
count(index='plos')
count(index='plos', type='article')
count(index='shakespeare')
count(index=c('plos','shakespeare'), q="a*")
count(index=c('plos','shakespeare'), q="z*")

# Curl options
library("httr")
count(callopts=verbose())

## End(Not run)

ropensci/elastic documentation built on Oct. 26, 2018, 7:11 p.m.