Document ID conventions


(Mauri) #1

Hello,

I have not used ES before and am having trouble finding any guidelines
on what constitutes a valid document ID (that follows the type in
index and get operations).
The examples in the guide use numbers while the auto generated IDs are
base 64 UUIDs based on a 128 bit number.
Are the document IDS restricted to the string representation of
numbers or are they arbitrary strings?
If strings, what characters are allowed (eg I expect a '/' is not
allowed as it is the delimiter for URIs, any other) ?
Any other restrictions on what cannot be used for document IDS, such
as reserved IDs?

Regards
Mauri


(Shay Banon) #2

There are not constraints on characters that can be used as the id. Even '/'
can be used, though you might need to escape it, for example, id of value
"1/2" will be passes like this:

curl -XPUT localhost:9200/test/type1/1%2F2 -d '{
"field" : "value"
}'

On Wed, Oct 19, 2011 at 2:16 AM, Mauri mauri@proactive-edge.com.au wrote:

Hello,

I have not used ES before and am having trouble finding any guidelines
on what constitutes a valid document ID (that follows the type in
index and get operations).
The examples in the guide use numbers while the auto generated IDs are
base 64 UUIDs based on a 128 bit number.
Are the document IDS restricted to the string representation of
numbers or are they arbitrary strings?
If strings, what characters are allowed (eg I expect a '/' is not
allowed as it is the delimiter for URIs, any other) ?
Any other restrictions on what cannot be used for document IDS, such
as reserved IDs?

Regards
Mauri


(Mauri) #3

Thankyou Shay, Just the answer I was hoping for.


(system) #4