Combined document id combined form several fields?

Hi,

I've read http://www.elasticsearch.org/guide/reference/mapping/id-field.html and
have a followup question:

Is that possible to construct document id from several fields? For example,
user's First and Last names?

I've tried something like
{
"_id" : {
"path" : [ "first_name", "last_name" ]
}
}
}

But it falls back to default auto ID.

--

Create a field, unstored and not indexed, with the value you want, and set
the path to it

On Sun, Nov 18, 2012 at 8:38 PM, Zaar Hai haizaar@gmail.com wrote:

Hi,

I've read
http://www.elasticsearch.org/guide/reference/mapping/id-field.html and
have a followup question:

Is that possible to construct document id from several fields? For
example, user's First and Last names?

I've tried something like
{
"_id" : {
"path" : [ "first_name", "last_name" ]
}
}
}

But it falls back to default auto ID.

--

--

Yeah, that's an easy cheat :slight_smile:
But I do not want another field.

May be there is a way to apply a script to generate an ID?

On 18 בנוב 2012, at 20:45, Itamar Syn-Hershko itamar@code972.com wrote:

Create a field, unstored and not indexed, with the value you want, and set
the path to it

On Sun, Nov 18, 2012 at 8:38 PM, Zaar Hai haizaar@gmail.com wrote:

Hi,

I've read
http://www.elasticsearch.org/guide/reference/mapping/id-field.html and
have a followup question:

Is that possible to construct document id from several fields? For
example, user's First and Last names?

I've tried something like
{
"_id" : {
"path" : [ "first_name", "last_name" ]
}
}
}

But it falls back to default auto ID.

--

--

--

Why do you care about another field if it isn't indexed?

On Sun, Nov 18, 2012 at 9:56 PM, Zaar Hai haizaar@gmail.com wrote:

Yeah, that's an easy cheat :slight_smile:
But I do not want another field.

May be there is a way to apply a script to generate an ID?

On 18 בנוב 2012, at 20:45, Itamar Syn-Hershko itamar@code972.com wrote:

Create a field, unstored and not indexed, with the value you want, and set
the path to it

On Sun, Nov 18, 2012 at 8:38 PM, Zaar Hai haizaar@gmail.com wrote:

Hi,

I've read
http://www.elasticsearch.org/guide/reference/mapping/id-field.html and
have a followup question:

Is that possible to construct document id from several fields? For
example, user's First and Last names?

I've tried something like
{
"_id" : {
"path" : [ "first_name", "last_name" ]
}
}
}

But it falls back to default auto ID.

--

--

--

--

I don't like keeping redundant information around, especially when I'm going
to have 100m+ documents.
If I'm gong to generate ID myself, then I better supply it directly as document
ID while indexing it, instead of keeping as a field.

Zaar

On Sunday, November 18, 2012 10:53:46 PM UTC+2, Itamar Syn-Hershko wrote:

Why do you care about another field if it isn't indexed?

On Sun, Nov 18, 2012 at 9:56 PM, Zaar Hai <hai...@gmail.com <javascript:>>wrote:

Yeah, that's an easy cheat :slight_smile:
But I do not want another field.

May be there is a way to apply a script to generate an ID?

On 18 בנוב 2012, at 20:45, Itamar Syn-Hershko <ita...@code972.com<javascript:>>
wrote:

Create a field, unstored and not indexed, with the value you want, and
set the path to it

On Sun, Nov 18, 2012 at 8:38 PM, Zaar Hai <hai...@gmail.com <javascript:>

wrote:

Hi,

I've read
http://www.elasticsearch.org/guide/reference/mapping/id-field.html and
have a followup question:

Is that possible to construct document id from several fields? For
example, user's First and Last names?

I've tried something like
{
"_id" : {
"path" : [ "first_name", "last_name" ]
}
}
}

But it falls back to default auto ID.

--

--

--

--