Sphinx通配符不符合预期的全部

时间:2019-06-27 09:22:46

标签: wildcard sphinx

我的查询是:

select * from words where match('*а$') LIMIT 1000000 OPTION max_matches=1000000;

我想找到所有以“ a”结尾的单词;但是狮身人面像只返回一部分-并非全部

我的配置是:

index words
{
        source = words
        path = /var/www/sphinx/words
        docinfo = extern
        mlock = 0
        #min_word_len = 1
        #morphology = stem_ru
        charset_table = 0..9, A..Z->a..z, _,-, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F
        min_infix_len = 1
        index_exact_words=1
        expand_keywords=0
        dict=keywords
}

结果只是在结尾处带有精确“ a”的单词:

word a
word-a
word(a)
word2 a
etc...

但是我需要像正则表达式“ a $”这样的完全匹配-wordA,wwwordA,wordsA

1 个答案:

答案 0 :(得分:1)

$是字段结束符-如果单词是字段中的最后(或唯一)一个单词,它将返回一个匹配项。如果只需要所有以a结尾的单词,则只需要MATCH('*a')