这是我的 sphinxsarch 配置:
source mysource
{
type = xmlpipe2
xmlpipe_command = cat /mnt/e/sphinx/data/documents.xml
xmlpipe_attr_uint = id
xmlpipe_field = title
xmlpipe_field = content
xmlpipe_fixup_utf8 = 1
}
index myindex
{
type = plain
path = /mnt/e/sphinx/data/
#docinfo = extern
html_strip = 1
morphology = stem_en
min_word_len = 3
min_prefix_len = 0
min_infix_len = 2
# which document source to index
source = mysource
}
indexer
{
mem_limit = 1024M
}
searchd
{
listen = 9312
log = /opt/sphinx/log/searchd.log
query_log = /opt/sphinx/log/query.log
read_timeout = 5
client_timeout = 300
max_children = 30
pid_file = /opt/sphinx/searchd.pid
}
这是我的 xml 文件(不完整):
<?xml version='1.0' encoding='utf-8'?>
<sphinx:docset><sphinx:document id="20230311163114937546"><title>unknown00001.txt</title><content>the happiness ....
退货
Sphinx 3.5.1 (commit 82c60cb)
Copyright (c) 2001-2023, Andrew Aksyonoff
Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
using config file 'sphinx.conf'...
WARNING: datadir: explicit index 'path' is deprecated; please convert your config to use 'datadir' directive
indexing index 'myindex'...
ERROR: source 'mysource': attribute 'id' declared multiple times; WILL NOT INDEX
索引不走运。我需要帮助,也许这是一个错误。期待 ;)
我尝试了索引,我认为由于配置它没有进行索引,它应该可以工作,因为我的 xml 文件已经按照 xmlpipe2 的 Sphinxsearch 文档中提到的进行了结构化,但我的配置不起作用,
datadir
指令可以在配置文件的 common
部分指定
应该更新一些配置指令“with
paths
”。这些包括log
、query_log
、binlog_path
、pid_file
、lemmatizer_base
和sphinxql_state
指令。
更多在这里