I want to use 2 indexes (querys), but sphinx gives this warning:
[sphinx@reea3 ~]$ /usr/bin/indexer --config /home/sphinx/sphinx/sphinx.conf --all --rotate
Sphinx 0.9.9-release (r2117)
Copyright (c) 2001-2009, Andrew Aksyonoff
using config file '/home/sphinx/sphinx/sphinx.conf'...
indexing index 'job1'...
collected 6 docs, 0.0 MB
sorted 0.0 Mhits, 100.0% done
total 6 docs, 837 bytes
total 0.005 sec, 152988 bytes/sec, 1096.69 docs/sec
indexing index 'job2'...
collected 8 docs, 0.0 MB
sorted 0.0 Mhits, 100.0% done
total 8 docs, 151 bytes
total 0.002 sec, 53794 bytes/sec, 2850.01 docs/sec
total 10 reads, 0.000 sec, 0.2 kb/call avg, 0.0 msec/call avg
total 20 writes, 0.000 sec, 0.3 kb/call avg, 0.0 msec/call avg
WARNING: failed to open pid_file '/var/run/sphinx/searchd.pid'.
WARNING: indices NOT rotated.
Below is the source code.
I have taken out the sql query and attribute list.
Whats to be done in order for SPHINX to rotate indices?
#
# Minimal Sphinx configuration sample (clean, simple, functional)
#
source jobSource1
{
type = mysql
sql_host = localhost
sql_user = root
# sql_pass = 123456
sql_pass =
sql_db = dbx
sql_port = 3306
sql_query = sql_query
sql_attr_uint = attributes go here
sql_attr_str2ordinal = attributes go here
}
source jobSource2
{
type = mysql
sql_host = localhost
sql_user = root
# sql_pass = 123456
sql_pass =
sql_db = dbx
sql_port = 3306
sql_query = sql_query
sql_attr_uint = attribute
sql_attr_str2ordinal = attribute
}
index job1
{
source = jobSource1
path = /home/sphinx/jobs/job1
docinfo = extern
charset_type = utf-8
}
index job2
{
source = jobSource2
path = /home/sphinx/jobs/job1
docinfo = extern
charset_type = utf-8
}
indexer
{
mem_limit = 32M
}
searchd
{
port = 9312
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 = 0
unlink_old = 1
}
Actually, after a brainstorming seasion with my colleagues, we talked to the admins, and it turned out that the searchd process was initialized using the root priviledges, so only the root user could modify the file.
After restarting the process with the normal priviledges, everithing turned out to be working just fine;