Hi,
I am using ES 5.1.2.
I would like to store emails (or any other string with special characters for that matter), and enable ngram search.
For example: Store "carlos.santana.1925@yat.co.tod".
Return the document when searching for "19 25@ya ".
BUT, not return it when searching "carlos.santana.19-25@yat.co.tod".
I defined the field like so:
"address": {
"type": "text",
"fields": {
"email_field": {
"type": "text",
"analyzer": "ngram_with_special_chars",
"search_analyzer": "keyword"
}
},
"analyzer": "ngram_with_special_chars",
"search_analyzer": "keyword"
}
Where:
Filter:
"lang_ngram_special_char_filter": {
"token_chars": "[]",
"min_gram": "2",
"type": "nGram",
"max_gram": "10"
}
Analyzers:
"ngram_with_special_chars": {
"filter": [
"lowercase",
"spanish_stop",
"spanish_keywords",
"lang_ngram_special_char_filter"
],
"type": "custom",
"tokenizer": "keyword"
},
"keyword": {
"filter": [
"all_chars_included_in_token"
],
"type": "custom",
"tokenizer": "uax_url_email"
},
BUT:
GET /person_index/_search
{
"query": {
"bool": {
"should" : {
"query_string" : {
"query": "carlos.santana.19-25@yat.co.tod"
}
}
}
},
"explain": true,
"highlight": {
"fields": {
"*": {}
}
}
}
Still finds the string "carlos.santana.1925@yat.co.tod".
How to make it not find it?