Answer the question
In order to leave comments, you need to log in
How to use Sphinx along with laravel php framework? Need a kick?
For laravel, there is a Sphinx extension - a link on the github https://github.com/scalia/sphinxsearch. I can't figure out what to put in 'my_keywords_table', and 'id'
return array (
'host' => '127.0.0.1',
'port' => 9312,
'indexes' => array (
'my_index_name' => array ( 'table' => 'my_keywords_table', 'column' => 'id' ),
)
);
$results = SphinxSearch::search('my query', 'index_name')
->limit(30)
->filter('attribute', array(1, 2))
->range('int_attribute', 1, 10)
->get();
Answer the question
In order to leave comments, you need to log in
The my_keywords_table field is your table to be searched, and column is the actual field in the table to be searched.
According to the sources: https://github.com/scalia/sphinxsearch/blob/master/src/Scalia/SphinxSearch/SphinxSearch.php
DB::table($config['table'])->whereIn($config['column'], $matchids)->get();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question