Answer the question
In order to leave comments, you need to log in
How to properly configure sphinx config?
Hello!
There is a debian server, installed sphinx /etc/sphinxsearch/ I
went into my project on Yii 2 in the config folder and created a sphinx.conf
file
in which:
source films
{
type = mysql
sql_host = localhost
sql_user = ***
sql_pass = ***
sql_db = ***
sql_query_pre = SET NAMES utf8
sql_query = SELECT id, h2, text_not_index, keyname FROM films
}
indexer
{
mem_limit = 256M
}
index films
{
source = films
path = /var/lib/sphinxsearch/data/****
charset_type = utf-8
morphology = stem_enru
min_word_len = 2
charset_table = 0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F, U+401->U+451, U+451
blend_chars = &, ., +, U+23
min_infix_len = 2
enable_star = 1
index_exact_words = 1
html_strip = 1
}
searchd
{
listen = localhost:9306:mysql41
}
'sphinx' => [
'class' => 'yii\sphinx\Connection',
'dsn' => 'mysql:host=localhost;port=9306;dbname=***',
'username' => '***',
'password' => '***,
],
public function actionSphinx() {
$query = new \yii\sphinx\Query;
echo '</pre>';
print_r($query->from('films')->match('Dead')->all());
exit;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question