本文介绍了配置ElasticSearch默认使用ngram。 - SQL LIKE %%行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果索引包含This document is MySuperInvoice,我想要如果我正在寻找超级,文档或声音,可以找到它
感谢您的帮助。
编辑
有人告诉我,我需要把*放在我的搜索条件下: * query *
让我们了解如何使用haystack完成这个工作。
解决方案
确定我终于到了,谢谢@zebuline。
集群:
名称:webapp
网络:
bind_host:0.0.0.0
publish_host:_eth0_
索引:
分析:
分析器:
default_index:
键入:custom
tokenizer:standard
过滤器:[标准,小写,asciifolding,webapp_ngram]
default_search:
类型:自定义
标记符:标准
过滤器:[标准,小写,asciifolding]
过滤器:
webapp_ngram:
类型:nGram
min_gram:1
max_gram:30
Is it possible to configure the elasticsearch index behavior to ack as the LIKE keyword of SQL.
If the index contains "This document is called MySuperInvoice", I want to be able to find it if I am looking for super, doc or voice"
Thank you for your help.
Edit:
Somebody tells me that I need to put * around my search terms : *query*
Lets see how this can be done using haystack.
解决方案
Ok I finally got there. Thanks @zebuline.
cluster:
name: webapp
network:
bind_host: 0.0.0.0
publish_host: _eth0_
index:
analysis:
analyzer:
default_index:
type: custom
tokenizer: standard
filter: [standard, lowercase, asciifolding, webapp_ngram]
default_search:
type: custom
tokenizer: standard
filter: [standard, lowercase, asciifolding]
filter:
webapp_ngram:
type: nGram
min_gram: 1
max_gram: 30
这篇关于配置ElasticSearch默认使用ngram。 - SQL LIKE %%行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!