Cannot use "+" in document id

I would like to search a document using below query and my document id contains "+" character.

GET tpp_lookup_1808/_doc/2FDC1B40E46EMD5DOHcKn5%2FR%2Bq6Wiipsx8Hkg==2020

in the response from kibana, "+" character is replaced by white space and document couldn't find.

{
  "_index" : "tpp_lookup_1808",
  "_type" : "_doc",
  "_id" : "2FDC1B40E46EMD5DOHcKn5/R q6Wiipsx8Hkg==2020",
  "found" : false
}
  1. how can i pass special characters through GET API requests?

Thanks for the help.

What version are you using? This PR fixes encoding but I think your issue is decoding.

You have %2B in your API request which is a + sign. So it's not decoding it properly. Could be the same issue.

1 Like

thanks for the response..
I am using elastic search 7.3.2.
i am using this query in a streaming application and currently encoding "+" with %2B and querying ES. below are my doubts:

  1. how can I pass characters like [/,+] in GET request without encoding?
  2. is it a bug/issue from ES side?
  3. [/,+] characters are working with match query when id is inside double quotes. whether it means ES cant accept special characters with direct GET API query?

it seem ES team is working on this issue and currently no solution available.(pls correct if I am wrong)

thanks for the help.

The bug referenced was fixed in 7.4 release so I would update to attempt to clear it.

1 Like

thanks for the response...helped alot.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.