Friday, March 10, 2017

Can we create indexe's with sphinx using laravel?

I have sphinx working in laravel 5.3, but i want to confirm if it's possible to add, edit or delete an index. I am configurating in ---> ../Sphinx/bin -- my sphinx.conf file, every index I need, and then in cmd, I am running --> indexer --rotate --all . Then in laravel i use this lines:

<?php
return array(
    'host'    => '127.0.0.1',
    'port'    => 9312,
    'timeout' => 30,
    'indexes' => array(
        'test1' => array('table' => 'users', 'column' => 'id'),
        'test2'  => array('table' => 'cliente','column' => 'id'),
        'test3'  => array('table' => 'imovel', 'column' => 'id'),
        'test4'  => array('table' => 'cliente', 'column' => 'id'),

    ),
    'mysql_server' => array(
        'host' => '127.0.0.1',
        'port' => 3306
    )
);

This code is is sphinxsearch.php, and with this, i can call my indexe's. So, is possible to add index here like i do on sphinx.conf file, or this declarations are limited only to use the indexe's that were created on that file?

Ty in advance



via António Gonçalves

Advertisement