Answer the question
In order to leave comments, you need to log in
There is a simple sphinx config, why doesn't it work?
I am trying to configure php config to work in yii2.
So far, I'm just testing everything in the console and this is what I have, this is the config:
source selposts
{
type = mysql
sql_host = localhost
sql_user = username
sql_pass = password
sql_db = databasename
sql_port = 3306 # optional, default is 3306
sql_query = SELECT header, text FROM sel_posts WHERE header != 'NULL'
}
index posts
{
source = selposts
path = /var/lib/sphinx/selectner/posts
charset_type = utf-8
}
indexer
{
mem_limit = 128M
}
searchd
{
listen = 9312
listen = 9306:mysql41
log = /var/log/sphinx/searchd.log
query_log = /var/log/sphinx/query.log
read_timeout = 5
max_children = 30
pid_file = /var/run/sphinx/searchd.pid
max_matches = 1000
seamless_rotate = 1
preopen_indexes = 1
unlink_old = 1
workers = threads # for RT to work
binlog_path = /var/lib/sphinx/
}
[email protected] [/var/lib/sphinx]# indexer posts
Sphinx 2.0.9-id64-release (rel20-r4115)
Copyright (c) 2001-2013, Andrew Aksyonoff
Copyright (c) 2008-2013, Sphinx Technologies Inc (http://sphinxsearch.com)
using config file '/etc/sphinx/sphinx.conf'...
indexing index 'posts'...
WARNING: Attribute count is 0: switching to none docinfo
WARNING: source selposts: skipped 14 document(s) with zero/NULL ids
collected 0 docs, 0.0 MB
total 0 docs, 0 bytes
total 0.003 sec, 0 bytes/sec, 0.00 docs/sec
total 1 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
total 5 writes, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
[email protected] [/var/lib/sphinx]#
Answer the question
In order to leave comments, you need to log in
You must have an ID for each entry in order to work with sphinx.
sql_query = SELECT id, header, text FROM sel_posts WHERE header != 'NULL'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question