mysql - 如何运行狮身人面像?
问题描述
昨天我开始掌握狮身人面像。
一切进展顺利。
但是今天我不明白我的问题是什么。
当我创建索引时:
C:/sphinx/bin/indexer --all --config C:/sphinx/config/sphinx.conf
我连接狮身人面像:
C:/sphinx/bin/searchd --install --config C:/sphinx/config/sphinx.conf --servicename SphinxSearch
我在服务中打开它。
CMD 命令:
C:/Users/WINDOWS/Desktop/xampp/mysql/bin/mysql.exe -h 127.0.0.1 -P 9306
MySQL 命令:
show tables;
结论:
Empty set (0.000 sec)
配置:
source src1
{
type = mysql
sql_host = localhost
sql_user = root
sql_pass =
sql_db = test
sql_port = 3306
sql_query = \
SELECT id, group_id, UNIX_TIMESTAMP (date_added) AS date_added, title, content \
FROM documents
sql_attr_uint = group_id
sql_attr_timestamp = date_added
}
index test1
{
source = src1
path = C:/sphinx/data/test1
}
index testrt
{
type = rt
rt_mem_limit = 128M
path = C:/sphinx/data/testrt
rt_field = title
rt_field = content
rt_attr_uint = gid
}
indexer
{
mem_limit = 128M
}
searchd
{
listen = 9312
listen = 9306: mysql41
log = C:/sphinx/log/searchd.log
query_log = C:/sphinx/log/query.log
read_timeout = 5
max_children = 30
pid_file = C:/sphinx/log/searchd.pid
seamless_rotate = 1
preopen_indexes = 1
unlink_old = 1
workers = threads # for RT to work
binlog_path = C:/sphinx/data
}
没有帮助:
C:/sphinx/bin/indexer --all --config C:/sphinx/config/sphinx.conf --rotate
PS。
文件在 C:/sphinx/data 目录中创建。
我多次删除该服务:
C:/sphinx/bin/searchd --servicename SphinxSearch --delete
并给出了不同的名字:
C:/sphinx/bin/searchd --install --config C:/sphinx/config/sphinx.conf --servicename RandomName
我所有的文件夹和文件都已就位。
桌子:
CREATE TABLE test.documents
(
id INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT,
group_id INTEGER NOT NULL,
group_id2 INTEGER NOT NULL,
date_added DATETIME NOT NULL,
title VARCHAR (255) NOT NULL,
content TEXT NOT NULL
);
REPLACE INTO test.documents (id, group_id, group_id2, date_added, title, content) VALUES
(1, 1, 5, NOW (), 'test one', 'this is my test document number one. Also checking search within phrases.'),
(2, 1, 6, NOW (), 'test two', 'this is my test document number two'),
(3, 2, 7, NOW (), 'another doc', 'this is another group'),
(4, 2, 8, NOW (), 'doc number four', 'this is to test groups');
CREATE TABLE test.tags
(
docid INTEGER NOT NULL,
tagid INTEGER NOT NULL,
UNIQUE (docid, tagid)
);
INSERT INTO test.tags VALUES
(1,1), (1,3), (1,5), (1,7),
(2.6), (2.4), (2.2),
(3.15),
(4.7), (4.40);
SHOW DATABASES;
Empty set (0.002 sec)
解决方案
推荐阅读
- angularjs - Angular JS - 使用通用模板区分保存和更新
- typescript - Typescript Pick 文字类型
- javascript - Mongoose - 如何在预(保存/更新)中间件中抛出多个错误?
- python - 阅读组名为 Telethon(电报)的消息
- c# - 如何为 OpenApi 标头设置字符串列表
- excel - 将列添加到源表后刷新电源查询?
- bash - `set -x` 会导致 bash 打印到哪里?
- json - 如何在Ms access VBA中的记录集中更新之前验证数据
- cookies - 刮亚马逊。搜索结果从一台机器到另一台机器完全不同
- c# - 我可以在不编码的情况下使用 Response.Redirect 吗?