我遇到了Sphinx搜索索引問題。我一直從它得到空的結果集。Sphinx搜索索引
source mrc
{
type = mysql
sql_host = localhost
sql_user = root
sql_pass =
sql_db = test_db
sql_port = 3306
mysql_connect_flags = 32
sql_query_pre = SET NAMES latin1
sql_query_pre = SET SESSION query_cache_type=OFF
sql_query_pre = REPLACE INTO sphinx.indexer (idx,server,version,lastrun_at) SELECT 'mrc','localhost','2.0.4',UNIX_TIMESTAMP(NOW()) FROM DUAL
sql_query_post = UPDATE sphinx.indexer SET fetched_by = UNIX_TIMESTAMP(NOW()) WHERE idx = 'mrc' AND server = 'localhost' AND version = '2.0.4'
sql_query_post_index = UPDATE sphinx.indexer SET indexed_by = UNIX_TIMESTAMP(NOW()) WHERE idx = 'mrc' AND server = 'localhost' AND version = '2.0.4'
sql_attr_uint = mrc_id
sql_attr_uint = mrc_parent
sql_attr_float = mrc_latitude
sql_attr_float = mrc_longitude
sql_query = \
SELECT mrc_id AS doc_id, \
mrc_id, \
mrc_parent, \
RADIANS(mrc_latitude) as mrc_latitude, \
RADIANS(mrc_longitude) as mrc_longitude \
FROM mrc_table \
WHERE mrc_parent > 0
sql_query_info = SELECT * FROM mrc_table WHERE mrc_id = $id
}
index mrc
{
charset_type = sbcs
docinfo = extern
mlock = 1
morphology = none
source = mrc
path = /usr/local/var/data/mrc
}
索引給我 -
indexing index 'member_region_cities'...
collected 78312 docs, 0.0 MB
total 78312 docs, 0 bytes
total 0.656 sec, 0 bytes/sec, 119354.57 docs/sec
如果我通過連接mysql的到searchd,做
SELECT * FROM mrc_table;
它返回空。
的Theres肯定是在本地主機表中的數據,你可以看到它在索引說「收集78312」
那麼,爲什麼不獅身人面像將數據放入searchd的?
乾杯
不錯,我在發佈之前將索引中的所有member_region_cities替換爲mrc,這就是索引器輸出的原因。 索引工具輸出 - 總文件:78312,並感謝您的提示,我不知道索引工具 而且肯定連接到正確的服務器。 – Marklar 2012-07-09 20:01:47
那麼SELECT * FROM mrc仍然是空的? – vfedorkov 2012-07-10 08:27:32
您使用哪個Sphinx版本? – vfedorkov 2012-07-10 08:36:02