File tree Expand file tree Collapse file tree 4 files changed +52
-22
lines changed
src/Elasticsearch/Helper/Iterators
tests/Elasticsearch/Tests/Helper/Iterators Expand file tree Collapse file tree 4 files changed +52
-22
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ public function rewind(): void
77
77
78
78
$ this ->count = 0 ;
79
79
if (isset ($ current_page ['hits ' ]) && isset ($ current_page ['hits ' ]['total ' ])) {
80
- $ this ->count = $ current_page ['hits ' ]['total ' ];
80
+ $ this ->count = $ current_page ['hits ' ]['total ' ][ ' value ' ] ?? $ current_page [ ' hits ' ][ ' total ' ] ;
81
81
}
82
82
83
83
$ this ->readPageData ();
Original file line number Diff line number Diff line change @@ -100,12 +100,14 @@ private function clearScroll(): void
100
100
{
101
101
if (!empty ($ this ->scroll_id )) {
102
102
$ this ->client ->clearScroll (
103
- array (
104
- 'scroll_id ' => $ this ->scroll_id ,
105
- 'client ' => array (
103
+ [
104
+ 'body ' => [
105
+ 'scroll_id ' => $ this ->scroll_id
106
+ ],
107
+ 'client ' => [
106
108
'ignore ' => 404
107
- )
108
- )
109
+ ]
110
+ ]
109
111
);
110
112
$ this ->scroll_id = null ;
111
113
}
@@ -135,8 +137,10 @@ public function next(): void
135
137
{
136
138
$ this ->current_scrolled_response = $ this ->client ->scroll (
137
139
[
138
- 'scroll_id ' => $ this ->scroll_id ,
139
- 'scroll ' => $ this ->scroll_ttl
140
+ 'body ' => [
141
+ 'scroll_id ' => $ this ->scroll_id ,
142
+ 'scroll ' => $ this ->scroll_ttl
143
+ ]
140
144
]
141
145
);
142
146
$ this ->scroll_id = $ this ->current_scrolled_response ['_scroll_id ' ];
Original file line number Diff line number Diff line change @@ -64,7 +64,10 @@ public function testWithHits()
64
64
[ 'foo ' => 'bar1 ' ],
65
65
[ 'foo ' => 'bar2 ' ]
66
66
],
67
- 'total ' => 3
67
+ 'total ' => [
68
+ 'value ' => 3 ,
69
+ 'relation ' => 'eq '
70
+ ]
68
71
]
69
72
],
70
73
[
@@ -74,7 +77,10 @@ public function testWithHits()
74
77
[ 'foo ' => 'bar1 ' ],
75
78
[ 'foo ' => 'bar2 ' ]
76
79
],
77
- 'total ' => 3
80
+ 'total ' => [
81
+ 'value ' => 3 ,
82
+ 'relation ' => 'eq '
83
+ ]
78
84
]
79
85
],
80
86
[
@@ -84,7 +90,10 @@ public function testWithHits()
84
90
[ 'foo ' => 'bar1 ' ],
85
91
[ 'foo ' => 'bar2 ' ]
86
92
],
87
- 'total ' => 3
93
+ 'total ' => [
94
+ 'value ' => 3 ,
95
+ 'relation ' => 'eq '
96
+ ]
88
97
]
89
98
],
90
99
[
@@ -94,7 +103,10 @@ public function testWithHits()
94
103
[ 'foo ' => 'bar1 ' ],
95
104
[ 'foo ' => 'bar2 ' ]
96
105
],
97
- 'total ' => 3
106
+ 'total ' => [
107
+ 'value ' => 3 ,
108
+ 'relation ' => 'eq '
109
+ ]
98
110
]
99
111
],
100
112
[
@@ -103,7 +115,10 @@ public function testWithHits()
103
115
[ 'foo ' => 'bar3 ' ],
104
116
[ 'foo ' => 'bar4 ' ]
105
117
],
106
- 'total ' => 2
118
+ 'total ' => [
119
+ 'value ' => 2 ,
120
+ 'relation ' => 'eq '
121
+ ]
107
122
]
108
123
],
109
124
[
@@ -112,7 +127,10 @@ public function testWithHits()
112
127
[ 'foo ' => 'bar3 ' ],
113
128
[ 'foo ' => 'bar4 ' ]
114
129
],
115
- 'total ' => 2
130
+ 'total ' => [
131
+ 'value ' => 2 ,
132
+ 'relation ' => 'eq '
133
+ ]
116
134
]
117
135
]
118
136
);
Original file line number Diff line number Diff line change @@ -100,8 +100,10 @@ public function testWithHits()
100
100
->ordered ()
101
101
->with (
102
102
[
103
- 'scroll_id ' => 'scroll_id_01 ' ,
104
- 'scroll ' => '5m '
103
+ 'body ' => [
104
+ 'scroll_id ' => 'scroll_id_01 ' ,
105
+ 'scroll ' => '5m '
106
+ ]
105
107
]
106
108
)
107
109
->andReturn (
@@ -122,8 +124,10 @@ public function testWithHits()
122
124
->ordered ()
123
125
->with (
124
126
[
125
- 'scroll_id ' => 'scroll_id_02 ' ,
126
- 'scroll ' => '5m '
127
+ 'body ' => [
128
+ 'scroll_id ' => 'scroll_id_02 ' ,
129
+ 'scroll ' => '5m '
130
+ ]
127
131
]
128
132
)
129
133
->andReturn (
@@ -144,8 +148,10 @@ public function testWithHits()
144
148
->ordered ()
145
149
->with (
146
150
[
147
- 'scroll_id ' => 'scroll_id_03 ' ,
148
- 'scroll ' => '5m '
151
+ 'body ' => [
152
+ 'scroll_id ' => 'scroll_id_03 ' ,
153
+ 'scroll ' => '5m '
154
+ ]
149
155
]
150
156
)
151
157
->andReturn (
@@ -161,8 +167,10 @@ public function testWithHits()
161
167
->never ()
162
168
->with (
163
169
[
164
- 'scroll_id ' => 'scroll_id_04 ' ,
165
- 'scroll ' => '5m '
170
+ 'body ' => [
171
+ 'scroll_id ' => 'scroll_id_04 ' ,
172
+ 'scroll ' => '5m '
173
+ ]
166
174
]
167
175
);
168
176
You can’t perform that action at this time.
0 commit comments