elasticizer: update to account for syntax change in newer package versions

master
Erik de Vries 6 years ago
parent f6006eb9ba
commit f2312f65d5

@ -22,6 +22,8 @@ elasticizer <- function(query, src = T, index = 'maml', es_pwd = .rs.askForPassw
retries <- 10 ### Number of retries on error
sleep <- 30 ### Number of seconds between retries
httr::set_config(httr::config(http_version = 0))
## Transitional code for syntax change in elastic package
if (packageVersion("elastic") < 1) {
if (localhost == F) {
connect(es_port = 443,
es_transport = 'https',
@ -40,6 +42,26 @@ elasticizer <- function(query, src = T, index = 'maml', es_pwd = .rs.askForPassw
es_pwd = '',
errors = 'complete')
}
} else {
if (localhost == F) {
connect(port = 443,
transport = 'https',
host = 'linux01.uis.no',
path = 'es',
user = 'es',
pwd = es_pwd,
errors = 'complete')
}
if (localhost == T){
connect(port = 9200,
transport = 'http',
host = 'localhost',
path = '',
user = '',
pwd = '',
errors = 'complete')
}
}
# Get all results - one approach is to use a while loop
if (src == T) {
res <- NULL

Loading…
Cancel
Save