Skip to content

Commit 075ed7b

Browse files
author
Alexandre Gans
committed
how to search ordering the field query
1 parent a07cdde commit 075ed7b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

elastic/inner_hits.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
curl -XPOST "localhost:9200/index_name/_search?pretty" \
4+
-H 'Content-Type: application/json' \
5+
-d'{
6+
"size": 1,
7+
"query": {
8+
"match_all": {}
9+
},
10+
"collapse": {
11+
"field": "field.keyword",
12+
"inner_hits": {
13+
"name": "most_recent",
14+
"size": 10,
15+
"sort": [{"timestamp": "desc"}]
16+
}
17+
}
18+
}'

0 commit comments

Comments
 (0)