Hi, I met a problem these days that I cannot query backquote in elastic.
My setting included letter, digit, symbol and punctuation. But it seems that ` is not included. I tried version 1.6, 2.2 and 2.3 either. It seems the same.
Did anybody met this problem?
Can you provide code examples of what you are trying to do?
I saved three doc in elastic: {"name": "Test
"}, {"name": "'Test'"}, {"name": ""Test""}
When I post query: {"query":{"match":{"name":"'"}}}. It could give me the second doc.
But if I post query: {"query":{"match":{"name":"`"}}}. It got nothing.
My index settings:
"mappings": {
"index": {
"dynamic": "strict",
"properties": {
"name": {
"type": "string"
"term_vector": "with_positions_offsets"
"analyzer": "index_ngrams"
"search_analyzer": "search_ngrams"
}
}
}
"settings": {
"index": {
"mapper": {
"dynamic": "false"
}
"analysis": {
"analyzer": {
"search_ngrams": {
"filter": ["lowercase"]
"type": "custom"
"tokenizer": "whitespace"
}
"index_ngrams": {
"filter": [ "lowercase"]
"type": "custom"
"tokenizer": "ngram_tokenizer"
}
}
"tokenizer": {
"ngram_tokenizer": {
"token_chars": ["letter", "digit", "symbol", "punctuation"]
"min_gram": "1"
"type": "nGram"
"max_gram": "30"
}
}
}
I've found the reason that why elastic search didn't support back quote.
Back quote is considered as 'modifier symbol' in elastic. Now the symbol matcher only support 'currency', 'math' and 'other' symbols. You can see source code below:
SYMBOL { @Override public boolean isTokenChar(int c) { switch (Character.getType(c)) { case Character.CURRENCY_SYMBOL: case Character.MATH_SYMBOL: case Character.OTHER_SYMBOL: return true; default: return false; } } }
I think it should be a bug of elastic.