Elasticsearch index not_analyzed


(yqguo) #1

I have a data, example:
a b
this data beginning with multiple spaces and more than one space between this data.
My mapping set no_analyzed, save this data to es,when search this data,This data has only one space, example:
a b
I don't know why this is.


(Adrien Grand) #2

Can you provide us with a recreation of the bug? For instance using curl commands.


(yqguo) #3

1.curl -XPOST 'http://10.3.35.24:9200/aposts' -d '{
"mappings": {
"post": {
"properties": {
"msg": {
"type": "string",
"index": "not_analyzed",
"store": "yes"
}
}
}
}
}'

2.curl -XPUT http://10.3.35.24:9200/aposts/post/q -d '{"msg": " a b"}'

3.I use elasticsearch web ui Any Request perform a search command {"query":{"match_all":{}}},give me return result is " a b".I think that it is " a b". Why space is gone?There are multiple spaces between a and b, but query results and only one space.


(David Pilato) #4

What happens if you run a curl command to search?

What is "elastsearch web UI"?


(yqguo) #5

My original data has multiple consecutive spaces, but I looked at the results of only a single space .
elasticsearch web UI is port 9200.
I found ths problem, browser parsed consecutive spaces to one space.


(system) #6