File tree 3 files changed +16
-0
lines changed
3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -394,3 +394,4 @@ $result = SphinxQL::create($this->conn)
394
394
* ` Helper::create($conn)->dropFunction($udf_name) `
395
395
* ` Helper::create($conn)->attachIndex($disk_index, $rt_index) `
396
396
* ` Helper::create($conn)->flushRtIndex($index) `
397
+ * ` Helper::create($conn)->optimizeIndex($index) `
Original file line number Diff line number Diff line change @@ -275,4 +275,16 @@ public function flushRtIndex($index)
275
275
{
276
276
return $ this ->query ('FLUSH RTINDEX ' .$ this ->getConnection ()->quoteIdentifier ($ index ));
277
277
}
278
+
279
+ /**
280
+ * OPTIMIZE INDEX syntax
281
+ *
282
+ * @param string $index
283
+ *
284
+ * @return SphinxQL A SphinxQL object ready to be ->execute();
285
+ */
286
+ public function optimizeIndex ($ index )
287
+ {
288
+ return $ this ->query ('OPTIMIZE INDEX ' .$ this ->getConnection ()->quoteIdentifier ($ index ));
289
+ }
278
290
}
Original file line number Diff line number Diff line change @@ -183,5 +183,8 @@ public function testMiscellaneous()
183
183
184
184
$ query = Helper::create ($ this ->conn )->flushRtIndex ('rt ' );
185
185
$ this ->assertEquals ('FLUSH RTINDEX rt ' , $ query ->compile ()->getCompiled ());
186
+
187
+ $ query = Helper::create ($ this ->conn )->optimizeIndex ('rt ' );
188
+ $ this ->assertEquals ('OPTIMIZE INDEX rt ' , $ query ->compile ()->getCompiled ());
186
189
}
187
190
}
You can’t perform that action at this time.
0 commit comments