java搜索使用百分比匹配Elasticsearch SpringBoot中的文本
我是一个新的Elasticsearch SpringBoot。我不知道如何使用百分比在Elasticsearch SpringBoot中搜索匹配文本。例如,我有一个文本“Hello world”。我可以设置50%或70%的百分比来匹配我的文本吗?我已经尝试使用property minimumShouldMatch,但现在似乎对我的案例不起作用。 谁能帮帮我,谢谢
你可以在下面搜索框中键入要查询的问题!
我是一个新的Elasticsearch SpringBoot。我不知道如何使用百分比在Elasticsearch SpringBoot中搜索匹配文本。例如,我有一个文本“Hello world”。我可以设置50%或70%的百分比来匹配我的文本吗?我已经尝试使用property minimumShouldMatch,但现在似乎对我的案例不起作用。 谁能帮帮我,谢谢
# 1 楼答案
您可以使用
should
查询,按术语拆分搜索短语,并根据您的词组设置minimum_should_match
示例查询
将找到
hello world
、hello alive
等要按术语拆分文本,您应该使用索引的分析
分析和拆分术语
它给出这样的结果来填充查询,并将术语分析器与查询相匹配,例如,如果您使用custom
analyzer