Running the latest ES and Node.js client, the below query produces an error "illegal_state_exception", "Can't get text on a START_ARRAY at 1:80", although the query seems to conform to the docs:
https://www.elastic.co/guide/en/elasticsearch/guide/current/bool-query.html
{
"query": {
"bool": {
"must": [
{
"match": {
"type": "posting"
}
},
{
"match": {
"userid": "10158245646690355"
}
}
],
"should": [
{
"match_phrase": {
"text": "xxx"
}
},
{
"match_phrase": {
"text": "xxxxxxxxxxxxx"
}
}
]
}
},
"highlight": {
"fields": {
"text": {
"fragment_size": 150,
"number_of_fragments": 3
}
}
},
"min_score": 0.95
}
console.js:8 [e[31mERRORe[39m] { Error: [illegal_state_exception] Can't get text on a START_ARRAY at 1:80
at respond (/Users/lee/src/thingy/node_modules/elasticsearch/src/lib/transport.js:289:15)
at checkRespForFailure (/Users/lee/src/thingy/node_modules/elasticsearch/src/lib/transport.js:248:7)
at HttpConnector.<anonymous> (/Users/lee/src/thingy/node_modules/elasticsearch/src/lib/connectors/http.js:164:7)
at IncomingMessage.wrapper (/Users/lee/src/thingy/node_modules/elasticsearch/node_modules/lodash/index.js:3095:19)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
status: 500,
displayName: 'InternalServerError',
message: '[illegal_state_exception] Can\'t get text on a START_ARRAY at 1:80',
path: '/postings/_search',
query: { size: 10000 },
body:
{ error:
{ root_cause: [Object],
type: 'illegal_state_exception',
reason: 'Can\'t get text on a START_ARRAY at 1:80' },
status: 500 },
statusCode: 500,
response: '{"error":{"root_cause":[{"type":"illegal_state_exception","reason":"Can\'t get text on a START_ARRAY at 1:80"}],"type":"illegal_state_exception","reason":"Can\'t get text on a START_ARRAY at 1:80"},"status":500}',
toString: [Function],
toJSON: [Function] } ' at User.getStorage.search.then.catch in ../lib/view/User.js:74'
Saw this possibly-related issue: https://github.com/elastic/elasticsearch/issues/15741