elasticsearch-sql icon indicating copy to clipboard operation
elasticsearch-sql copied to clipboard

Special Character can't search in ElasticSearch

Open mhsankar opened this issue 5 years ago • 3 comments

Hi what character we can't search in ElasticSearch? for example q=query('name:.') we can't search . character in ElasticSearch please give me list of character like this.

mhsankar avatar May 30 '19 09:05 mhsankar

Why not?

curl -XPUT -H 'Content-Type:application/json; charset=UTF-8' 'http://127.0.0.1:9200/test/test/1' -d '{
    "name" : "."
}'

curl -XPOST -H 'Content-Type:application/json; charset=UTF-8' 'http://127.0.0.1:9200/_sql?pretty' -d '{
    "sql":"SELECT * FROM test where q=query(\"name.keyword:.\")"
}'

image

shi-yuan avatar May 31 '19 02:05 shi-yuan

I test your code it is right. but it is not solve my problem when you create dynamic Index under every text field create one sub field with Keyword type. then you search in sub field with keyword type. how ever if you insert ". ab" in your index your can't search . character alone. it can't find. i want to search in Text type field. how do you search?

mhsankar avatar Aug 25 '19 12:08 mhsankar

except for the stop word .

SELECT * FROM test where q=query("name:.")

shi-yuan avatar Sep 08 '19 12:09 shi-yuan