ElasticSearch (Analyze Scripts)
Analyze Text Based on A Field
In this case, there is a sub-field called text.metaphone
. This command will analyze "My Text"
by using the analyzer for text.metaphone
.
GET /tms-009/_analyze
{
"field": "text.metaphone",
"text": "My Text"
}
metaphone
POST _analyze
{
"tokenizer": "standard",
"filter": [
"lowercase", "asciifolding",
{
"type": "phonetic",
"encoder": "metaphone"
}],
"text": "${searchTerm}"
}
double_metaphone
POST _analyze
{
"tokenizer": "standard",
"filter": [
"lowercase", "asciifolding",
{
"type": "phonetic",
"encoder": "double_metaphone",
"max_code_len": 100
}],
"text": "${searchTerm}"
}
soundex
POST _analyze
{
"tokenizer": "standard",
"filter": [
"lowercase", "asciifolding",
{
"type": "phonetic",
"encoder": "soundex"
}],
"text": "${searchTerm}"
}
refined_soundex
POST _analyze
{
"tokenizer": "standard",
"filter": [
"lowercase", "asciifolding",
{
"type": "phonetic",
"encoder": "refined_soundex"
}],
"text": "${searchTerm}"
}
caverphone1
POST _analyze
{
"tokenizer": "standard",
"filter": [
"lowercase", "asciifolding",
{
"type": "phonetic",
"encoder": "caverphone1"
}],
"text": "${searchTerm}"
}
caverphone2
POST _analyze
{
"tokenizer": "standard",
"filter": [
"lowercase", "asciifolding",
{
"type": "phonetic",
"encoder": "caverphone2"
}],
"text": "${searchTerm}"
}
cologne
POST _analyze
{
"tokenizer": "standard",
"filter": [
"lowercase", "asciifolding",
{
"type": "phonetic",
"encoder": "cologne"
}],
"text": "${searchTerm}"
}
nysiis
POST _analyze
{
"tokenizer": "standard",
"filter": [
"lowercase", "asciifolding",
{
"type": "phonetic",
"encoder": "nysiis"
}],
"text": "${searchTerm}"
}
koelnerphonetik
POST _analyze
{
"tokenizer": "standard",
"filter": [
"lowercase", "asciifolding",
{
"type": "phonetic",
"encoder": "koelnerphonetik"
}],
"text": "${searchTerm}"
}
haasephonetik
POST _analyze
{
"tokenizer": "standard",
"filter": [
"lowercase", "asciifolding",
{
"type": "phonetic",
"encoder": "haasephonetik"
}],
"text": "${searchTerm}"
}
beider_morse
POST _analyze
{
"tokenizer": "standard",
"filter": [
"lowercase", "asciifolding",
{
"type": "phonetic",
"encoder": "beider_morse",
"languageset": "english"
}],
"text": "${searchTerm}"
}
daitch_mokotoff
POST _analyze
{
"tokenizer": "standard",
"filter": [
"lowercase", "asciifolding",
{
"type": "phonetic",
"encoder": "daitch_mokotoff"
}],
"text": "${searchTerm}"
}