File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Expand file tree Collapse file tree 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)
394394* ` Helper::create($conn)->dropFunction($udf_name) `
395395* ` Helper::create($conn)->attachIndex($disk_index, $rt_index) `
396396* ` 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)
275275 {
276276 return $ this ->query ('FLUSH RTINDEX ' .$ this ->getConnection ()->quoteIdentifier ($ index ));
277277 }
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+ }
278290}
Original file line number Diff line number Diff line change @@ -183,5 +183,8 @@ public function testMiscellaneous()
183183
184184 $ query = Helper::create ($ this ->conn )->flushRtIndex ('rt ' );
185185 $ 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 ());
186189 }
187190}
You can’t perform that action at this time.
0 commit comments