我是狮身人面像搜索的新手,我有 PHP 7.1 centos 7.1 狮身人面像sphinx-2.2.1-1.rhel6.x86_64.rpm
以下是我的查询
$link = mysqli_connect('localhost', 'k***bster', '', '***', '9312');
$link->query('SELECT * FROM `prestasite` WHERE MATCH('paper') ORDER BY ord DESC LIMIT 0,10 OPTION ranker=bm25, field_weights=(name=20, reference=50, category=8, brand=8,tag=7);')
结果为空
但是当我在mysql的终端中尝试时,效果很好
当我检查/var/log/sphinx/query.log时 我只看到我在终端中运行的查询,但没有看到我在php代码中运行的查询
sphinx.conf
source prestasite
{
type = mysql
sql_host = localhost
sql_user = *
sql_pass =
sql_db = k***hop
sql_port = 3306 # optional, default is 3306
sql_query = SELECT d_product,name,reference,id_category,category, id_manufacturer,brand, tag, price,score from kob_catalog_view;
sql_attr_uint = id_category
sql_attr_uint = id_manufacturer
sql_attr_float = price
sql_attr_bigint = scoresource prestasite
}
index prestasite
{
source = prestasite
path = /var/lib/sphinx/test1
}
indexer
{
mem_limit = 128M
}
searchd
{
listen = localhost:9312
listen = localhost: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
seamless_rotate = 1
preopen_indexes = 1
unlink_old = 1
workers = threads # for RT to work
binlog_path = /var/lib/sphinx
}