Elasticsearch char_filter replace any character with whitespace?

删除回忆录丶 提交于 2019-11-30 01:56:57

问题


I'm using elasticsearch for my Ruby on Rails application. I want to use char_filter to replace some characters with whitepace.

In tutorial of elasticsearch it says something like:

"mappings" : ["ph=>f", "qu=>q"]

I've tried the following:

"mappings" : ["ph=>\s", "qu=>\s"]

However it does not seem to work. Any ideas guys?


回答1:


You can use \uXXXX notation for spaces:

"mappings" : ["ph=>\s", "qu=>\\u0020"]


来源:https://stackoverflow.com/questions/15501517/elasticsearch-char-filter-replace-any-character-with-whitespace

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!