curl -H Content-Type application json http elastic-catalog services la

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
curl -H 'Content-Type: application/json' 'http://elastic-catalog.services.lamoda.tech:9200/catalog-ru/_search' --data $'{
"query": {
"bool": {
"filter": [
{
"terms": {
"sku": [
"AA001EWIVJ97",
"JA021AMDZMJ4",
"MU454AMEIRX3",
"MP002XM0RGOC",
"TE026AMELXM7",
"LE306AMEQOI5",
"RA084AMWKU36",
"TO052AMEJOC7",
"NI464BUKBAP4",
"BE031EWADNB7"
]
}
}
]
}
},
"size": 60,
"_source": {
"includes": [
"sku"
]
},
"sort": {
"_script": {
"type": "number",
"script": {
"lang": "painless",
"source": "params.positions[doc[\'sku\'].value]",
"params": {
"positions": {
"AA001EWIVJ97": 1,
"JA021AMDZMJ4": 2,
"MU454AMEIRX3": 3,
"MP002XM0RGOC": 4,
"TE026AMELXM7": 5,
"LE306AMEQOI5": 6,
"RA084AMWKU36": 7,
"TO052AMEJOC7": 8,
"NI464BUKBAP4": 9,
"BE031EWADNB7": 10
}
}
},
"order": "asc"
}
}
}
'