3.3.2.Testing analyzers(测试分析器)
POST _analyze
{
"analyzer": "whitespace",
"text": "The quick brown fox."}
POST _analyze
{
"tokenizer": "standard",
"filter": [ "lowercase", "asciifolding" ],
"text": "Is this déja vu?"}Positions and character offsets(位置和字符偏移)
PUT my_index
{
"settings": {
"analysis": {
"analyzer": {
"std_folded": { #1
"type": "custom",
"tokenizer": "standard",
"filter": [
"lowercase",
"asciifolding"
]
}
}
}
},
"mappings": {
"my_type": {
"properties": {
"my_text": {
"type": "text",
"analyzer": "std_folded" #2
}
}
}
}}
GET my_index/_analyze { #3
"analyzer": "std_folded", #4
"text": "Is this déjà vu?"}
GET my_index/_analyze { #5
"field": "my_text", #6
"text": "Is this déjà vu?"}Last updated