如何在字段中设置ik分析器以使用python在elasticsearch中进行查询?

我将Ik Analyzer放在索引中的映射中,我想用它来查询文档中的“中国”。但是它不起作用,结果始终是:{'took':25,'timed_out':False,'_shards':{'total':1,'successful':1,'skipped':0,'failed' :0},'hits':{'total':{'value':0,'relation':'eq'},'max_score':None,'hits':[]}} 有人知道如何解决这个问题吗?

这是我的映射: mappings

我的部分代码如下:

es.indices.create(index,ignore=400,body=mappings)
res = es.index(index=index,body=files)
res_search = es.search(index=index,body={"query":{"match":{"content":"中国"}}})

print(res_search)

iCMS 回答:如何在字段中设置ik分析器以使用python在elasticsearch中进行查询?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2249207.html

大家都在问