Sphinx 斯芬克斯n-gram&;charset_表

Sphinx 斯芬克斯n-gram&;charset_表,sphinx,Sphinx,我正在修改sphinx集群的字符集映射,我遇到了一个有点奇怪的问题,文档中没有涉及到这个问题。charset\u表和ngram\u chars定义的前一位作者将CJK unicode范围置于字符集映射和ngrams中 这有必要吗 如果没有,复制的目的是什么?我承认从未使用过ngram\u字符,但我认为ngram\u字符中列出的字符也需要在charset\u表中 “charset_table”定义所有被索引的字符,然后“ngram_chars”定义被分段的字符 如果仅在“charset_table

我正在修改sphinx集群的字符集映射,我遇到了一个有点奇怪的问题,文档中没有涉及到这个问题。
charset\u表
ngram\u chars
定义的前一位作者将CJK unicode范围置于字符集映射和ngrams中

这有必要吗


如果没有,复制的目的是什么?

我承认从未使用过ngram\u字符,但我认为
ngram\u字符中列出的字符也需要在
charset\u表中

“charset_table”定义所有被索引的字符,然后“ngram_chars”定义被分段的字符

如果仅在“charset_table”中,则将作为普通字索引


如果只在“ngram_chars”中,则没有效果

在做了一些广泛的测试之后,我将回答我自己的问题。事实证明,
charset_table
ngram_chars
是相辅相成的,而不是一个是另一个的子集

试运行 Docset

 <?xml version="1.0" encoding="utf-8"?>
 <sphinx:docset>
 <sphinx:schema>
    <sphinx:field name="foo"/>
     </sphinx:schema>
     <sphinx:document id="123">
    <foo><![CDATA[ぇえぉおかがきぎく]]></foo>
</sphinx:document>
</sphinx:docset>
只是
ngram\u字符

using config file 'sphinx.conf'...
index 'i_blah': query 'ぇ ': returned 0 matches of 0 total in 0.000 sec

using config file 'sphinx.conf'...
index 'i_blah': query 'ぇえぉおかがきぎく ': returned 1 matches of 1 total in 0.000 sec

displaying matches:
1. document=123, weight=1500

words:
1. 'ぇえぉおかがきぎく': 1 documents, 1 hits
using config file 'sphinx.conf'...
index 'i_blah': query 'ぇえぉおかがきぎく ': returned 1 matches of 1 total in 0.000 sec

displaying matches:
1. document=123, weight=9500

words:
1. 'ぇ': 1 documents, 1 hits
2. 'え': 1 documents, 1 hits
3. 'ぉ': 1 documents, 1 hits
4. 'お': 1 documents, 1 hits
5. 'か': 1 documents, 1 hits
6. 'が': 1 documents, 1 hits
7. 'き': 1 documents, 1 hits
8. 'ぎ': 1 documents, 1 hits
9. 'く': 1 documents, 1 hits

因此,如果字符出现在
ngram\u字符中,则
charset\u表中的字符出现在
ngram\u字符中
不会以任何方式影响索引。它们彼此不依赖。

我花了30分钟为它构建了一个测试场景。事实证明他们是独立的-检查我的答案。