File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -395,3 +395,5 @@ $result = SphinxQL::create($this->conn)
395395* ` Helper::create($conn)->attachIndex($disk_index, $rt_index) `
396396* ` Helper::create($conn)->flushRtIndex($index) `
397397* ` Helper::create($conn)->optimizeIndex($index) `
398+ * ` Helper::create($conn)->showIndexStatus($index) `
399+ * ` Helper::create($conn)->flushRamchunk($index) `
Original file line number Diff line number Diff line change @@ -287,4 +287,28 @@ public function optimizeIndex($index)
287287 {
288288 return $ this ->query ('OPTIMIZE INDEX ' .$ this ->getConnection ()->quoteIdentifier ($ index ));
289289 }
290+
291+ /**
292+ * SHOW INDEX STATUS syntax
293+ *
294+ * @param $index
295+ *
296+ * @return SphinxQL A SphinxQL object ready to be ->execute();
297+ */
298+ public function showIndexStatus ($ index )
299+ {
300+ return $ this ->query ('SHOW INDEX ' .$ this ->getConnection ()->quoteIdentifier ($ index ).' STATUS ' );
301+ }
302+
303+ /**
304+ * FLUSH RAMCHUNK syntax
305+ *
306+ * @param $index
307+ *
308+ * @return SphinxQL A SphinxQL object ready to be ->execute();
309+ */
310+ public function flushRamchunk ($ index )
311+ {
312+ return $ this ->query ('FLUSH RAMCHUNK ' .$ this ->getConnection ()->quoteIdentifier ($ index ));
313+ }
290314}
Original file line number Diff line number Diff line change @@ -186,5 +186,11 @@ public function testMiscellaneous()
186186
187187 $ query = Helper::create ($ this ->conn )->optimizeIndex ('rt ' );
188188 $ this ->assertEquals ('OPTIMIZE INDEX rt ' , $ query ->compile ()->getCompiled ());
189+
190+ $ query = Helper::create ($ this ->conn )->showIndexStatus ('rt ' );
191+ $ this ->assertEquals ('SHOW INDEX rt STATUS ' , $ query ->compile ()->getCompiled ());
192+
193+ $ query = Helper::create ($ this ->conn )->flushRamchunk ('rt ' );
194+ $ this ->assertEquals ('FLUSH RAMCHUNK rt ' , $ query ->compile ()->getCompiled ());
189195 }
190196}
You can’t perform that action at this time.
0 commit comments