java学习讨论群:725562382
2,自定义分析器Analyzer
curl -X PUT "192.168.0.120:9200/simple_example" -H 'Content-Type: application/json' -d'
{
"settings": {
"analysis": {
"analyzer": {
"rebuilt_simple": {
"tokenizer": "lowercase",
"filter": [
]
}
}
}
}
}
2.1. Whitespace Analyzer
whitespace 分析器,当它遇到空白字符时,就将文本解析成terms
示例:
curl -X POST "192.168.0.120:9200/_analyze" -H 'Content-Type: application/json' -d'
{
"analyzer": "whitespace",
"text": "The 2 QUICK Brown-Foxes jumped over the lazy dog\u0027s bone."
}
输出结果如下:
[ The, 2, QUICK, Brown-Foxes