Error: 400 - all shards failed

elasticsearch
r
Tags: #<Tag:0x00007fbc5f365290> #<Tag:0x00007fbc5f364138>

#1

I am trying to search specific column in an elasticsearch’s index. It works fine with the following code.

library(jsonlite)
library(elastic)

connect()

# Required variables;
index.name <- "acturial"
index.type <- "data"
col.name <- "drv_age"
value <- "63"

myQuery <- paste(col.name,value,sep = ":")

records.found <- Search(index.name,index.type,myQuery,lenient = TRUE)$hits$total

But when I search drv_age column for string value (for example “test”) then instead of giving 0 records, it gives me the following error.

Error: 400 - all shards failed

Please help me.

Complete ES error Stack is as follows.

Error: 400 - all shards failed
ES stack trace:

type: query_shard_exception
reason: failed to create query: {
“query_string” : {
“query” : “drv_age:test”,
“fields” : [ ],
“use_dis_max” : true,
“tie_breaker” : 0.0,
“default_operator” : “or”,
“auto_generate_phrase_queries” : false,
“max_determinized_states” : 10000,
“enable_position_increments” : true,
“fuzziness” : “AUTO”,
“fuzzy_prefix_length” : 0,
“fuzzy_max_expansions” : 50,
“phrase_slop” : 0,
“analyze_wildcard” : false,
“escape” : false,
“split_on_whitespace” : true,
“boost” : 1.0
}
}
index_uuid: 4ojqm18WTQ6_6s0n7mc8Eg
index: acturial


#3

Thanks for your question @farid123good

Make sure to set verbose errors on using connect, like connect(errors = "complete")

Do the same query, but ask for verbose curl output like Search(config = httr::verbose()) and share the request and response headers (remove any secure content)