Some of our update by query requests (https://www.elastic.co/guide/en/elasticsearch/reference/2.4/docs-update-by-query.html) are timing out and returning a 504 Gateway Timeout error:
status: 504,
displayName: 'GatewayTimeout',
message: 'Gateway Timeout'
What we're trying to do is find certain products that match the query_string and assign them a gender value.
Here's the query that is timing out:
POST /products/_update_by_query?conflicts=proceed
{
"script": {
"id": "gender_women",
"lang": "groovy"
},
"query": {
"query_string": {
"query": "category:(skirts)"
}
}
}
And the pre-defined script that changes the gender field on the product:
POST /_scripts/groovy/gender_women
{
"script": "ctx._source.gender = \"women\""
}
I'm wondering what the cause of the Gateway Timeouts usually is and what we can do to make sure the queries are executed successfully.
Some background on our index, its an online product based index with about 250k documents.
We're running Elasticsearch 2.4.1 on a cluster with 8GB memory, hosted on Elastic Cloud. The index in question has 3 shards and 1 replica.
Thank You!