The source block contains the type of source, username and password to the MySQL server. The first column of the SQL query should be a unique id. The SQL query will run on every index and dump the data to Sphinx index file. Below are descriptions of each field and the source block itself.
sql_query: This is the query thats dumps data to index.
source src1 { type = mysql sql_host = localhost sql_user = root sql_pass = password sql_db = test sql_port = 3306 # optional, default is 3306
sql_query = \ SELECT id, group_id, UNIX_TIMESTAMP(date_added) AS date_added, title, content \ FROM documents
Job for sphinxsearch.service failed because the control process exited with error code. See "systemctl status sphinxsearch.service" and "journalctl -xe"for details
stop
sudo searchd --stop
testing search
sudo search -c /etc/sphinxsearch/sphinx.conf google
$sphinxSearch = new \NilPortugues\Sphinx\SphinxClient();
//Do connection and set up search method... $sphinxSearch->setServer('127.0.0.1',9312);
// Do search... // Result would contain "The Amazing Spider-Man 2", to be in theatres in 2014. $sphinxSearch->setFilter('year',array(2014)); $result = $sphinxSearch->query('Spiderman','movies');
// Unset the filter to stop filtering by year // Now we'll get all the Spiderman movies. $sphinxSearch->removeFilter('year'); $result = $sphinxSearch->query('Spiderman','movies');