File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -90,8 +90,16 @@ public function search($query) {
90
90
* if not wipe the entire index
91
91
*/
92
92
public function delete ($ id =false ) {
93
- if (is_array ($ id ))
94
- return $ this ->transport ->deleteByQuery ($ id );
95
93
return $ this ->transport ->delete ($ id );
96
94
}
95
+
96
+ /**
97
+ * Flush this index/type combination
98
+ *
99
+ * @return array
100
+ * @param mixed $query Text or array based query to delete everything that matches
101
+ */
102
+ public function deleteByQuery ($ query ) {
103
+ return $ this ->transport ->deleteByQuery ($ query );
104
+ }
97
105
}
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ public function testDeleteByQuery() {
36
36
37
37
sleep (1 ); // To make sure the documents will be ready
38
38
39
- $ del = $ this ->search ->delete (array (
39
+ $ del = $ this ->search ->deleteByQuery (array (
40
40
'term ' => array ('title ' => 'cool ' )
41
41
));
42
42
You can’t perform that action at this time.
0 commit comments