Learn R Programming

elastic (version 0.3.0)

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

Description

Get counts of the number of records per index.

Usage

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 http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-count.html

Examples

Run this code
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())

Run the code above in your browser using DataLab