File tree 1 file changed +30
-0
lines changed
1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -78,3 +78,33 @@ GET /_search
78
78
79
79
<1> The document with id `1` from `my-index-000001` will be the first result.
80
80
<2> When `_index` is missing, all documents with id `4` from the queried indices will be pinned with the same score.
81
+
82
+ ==== Sorting
83
+
84
+ The `pinned` query internally uses the calculated relevance to pin the requested documents to the top of the results set.
85
+
86
+ As soon any sorting is involved, the pinned query will be have no effect.
87
+
88
+ [source,console]
89
+ --------------------------------------------------
90
+ POST /_search
91
+ {
92
+ "sort": [
93
+ {
94
+ "price": {
95
+ "order": "desc"
96
+ }
97
+ }
98
+ ],
99
+ "query": {
100
+ "pinned": {
101
+ "ids": [ "1", "4"],
102
+ "organic": {
103
+ "match": {
104
+ "description": "iphone"
105
+ }
106
+ }
107
+ }
108
+ }
109
+ }
110
+ --------------------------------------------------
You can’t perform that action at this time.
0 commit comments