When I use script to do aggregation and want to find two documents with the same fields in es, 504 bad gateway.
Maybe it is caused by too much data. Is there any solution?
I used partition.
{
"size": 0,
"aggs": {
"duplicateCount": {
"terms": {
"script": {
"source":"doc['id'].value ",
"lang": "painless"
},
"min_doc_count": 2,
"size": 10,
"include": {
"partition": 0,
"num_partitions": 10
}
},
"aggs": {
"duplicateDocuments": {
"top_hits": {
"size": 10
}
}
}
}
}
}
error
<html>
<head>
<title>504 Gateway Time-out</title>
</head>
<body>
<center>
<h1>504 Gateway Time-out</h1>
</center>
<hr>
<center>nginx</center>
</body>
</html>