Learn R Programming

elastic (version 0.7.8)

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 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

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

Run the code above in your browser using DataLab