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

master
Erik de Vries 6 years ago
parent f6006eb9ba
commit f2312f65d5

@ -22,23 +22,45 @@ elasticizer <- function(query, src = T, index = 'maml', es_pwd = .rs.askForPassw
retries <- 10 ### Number of retries on error retries <- 10 ### Number of retries on error
sleep <- 30 ### Number of seconds between retries sleep <- 30 ### Number of seconds between retries
httr::set_config(httr::config(http_version = 0)) httr::set_config(httr::config(http_version = 0))
if (localhost == F) { ## Transitional code for syntax change in elastic package
connect(es_port = 443, if (packageVersion("elastic") < 1) {
es_transport = 'https', if (localhost == F) {
es_host = 'linux01.uis.no', connect(es_port = 443,
es_path = 'es', es_transport = 'https',
es_user = 'es', es_host = 'linux01.uis.no',
es_pwd = es_pwd, es_path = 'es',
errors = 'complete') es_user = 'es',
} es_pwd = es_pwd,
if (localhost == T){ errors = 'complete')
connect(es_port = 9200, }
es_transport = 'http', if (localhost == T){
es_host = 'localhost', connect(es_port = 9200,
es_path = '', es_transport = 'http',
es_user = '', es_host = 'localhost',
es_pwd = '', es_path = '',
errors = 'complete') es_user = '',
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 # Get all results - one approach is to use a while loop
if (src == T) { if (src == T) {

Loading…
Cancel
Save