Character support in Document Id


(Ankitnaudiyal) #1

Hi Team,

I'm trying to index a tweet with author name as the Document Id. We have a requirement which requires us to have some names with special characters like @ symbol. After some trials it seems that it is not possible to use @ symbol in the Id field. PFB an example which I tried and got an error in response.
POST Twitter/tweet/@sheldon?refresh
{
"text":"Tweeting"
}

I faced same problem with # symbol as well, could not use an id with # in
I'm trying to look for resources which can help me with this problem. From a lot of documentations and responses from people it seems that Elastic does not restrict any characters in the Id field. I'm very surprised to experience this behavior.
Could someone provide their inputs on this?


(chintan visani) #2

I am able to create id with @ symbol but not able to create Id with # character it creates random generated id with #.


(Ankitnaudiyal) #3

Hi Chintan,
Could you provide me a sample how you are able to use @ in the id field. I've not been able to use it using the above posted request.


(chintan visani) #4

I am using head plugin to add into id field.

‚Äč


(system) #5