Duplicated _id returned as list

Hi,

the following query returns the _id twice as list instead of the single _id
in fields

{
"query": {
"text_phrase_prefix": {
"aSearchName": {
"max_expansions": 10,
"analyzer": "default",
"query": "recruiter"
}
}
},
"fields": [
"_id",
"aSearchName"
]
}

The result from my elasticsearch connection
and also elastichead looks like:

{

took: 9
timed_out: false
_shards: {
    total: 7
    successful: 7
    failed: 0
}
hits: {
    total: 1
    max_score: 0.9297228
    hits: [
        {
            _index: members
            _type: member
            _id: 501fc7117a93312324008d9f
            _score: 0.9297228
            fields: {
                _id: [
                    501fc7117a93312324008d9f
                    501fc7117a93312324008d9f
                ]
                aSearchName: Recruiter RECRUITER, Bern
            }
        }
    ]
}

}

The index mapping defines:
"_id": {"store": "yes"}

The elasticserver version is 0.19.4

Is this a known issue and solved in newer versions?

Mit freundlichem Gruss
Roger Ineichen


Projekt01 GmbH
www.projekt01.ch
Boesch 65
6331 Hünenberg
phone +41 (0)41 781 01 78
mobile +41 (0)79 340 52 32
fax +41 (0)41 781 00 78
email roger.ineichen@projekt01.ch


END OF MESSAGE

I just tried it with master and it still works this way. Here is repro

A possible workaround is to remove "_id" field from the source of the
document.

On Thursday, August 9, 2012 5:38:29 PM UTC-4, projekt01 wrote:

Hi,

the following query returns the _id twice as list instead of the single
_id
in fields

{
"query": {
"text_phrase_prefix": {
"aSearchName": {
"max_expansions": 10,
"analyzer": "default",
"query": "recruiter"
}
}
},
"fields": [
"_id",
"aSearchName"
]
}

The result from my elasticsearch connection
and also elastichead looks like:

{

took: 9 
timed_out: false 
_shards: { 
    total: 7 
    successful: 7 
    failed: 0 
} 
hits: { 
    total: 1 
    max_score: 0.9297228 
    hits: [ 
        { 
            _index: members 
            _type: member 
            _id: 501fc7117a93312324008d9f 
            _score: 0.9297228 
            fields: { 
                _id: [ 
                    501fc7117a93312324008d9f 
                    501fc7117a93312324008d9f 
                ] 
                aSearchName: Recruiter RECRUITER, Bern 
            } 
        } 
    ] 
} 

}

The index mapping defines:
"_id": {"store": "yes"}

The elasticserver version is 0.19.4

Is this a known issue and solved in newer versions?

Mit freundlichem Gruss
Roger Ineichen


Projekt01 GmbH
www.projekt01.ch
Boesch 65
6331 Hünenberg
phone +41 (0)41 781 01 78
mobile +41 (0)79 340 52 32
fax +41 (0)41 781 00 78
email roger.i...@projekt01.ch <javascript:>


END OF MESSAGE

Hi Igor,

Betreff: Re: duplicated _id returned as list

I just tried it with master and it still works this way. Here is repro -
Repro for double id problem · GitHub

A possible workaround is to remove "_id" field from the source of the document.

Ah thanks, didn't think about that. I was using the _id directly from the hits dict
as a workarround.

Can you add an issue with you gist sample or should I add one?

Regards
Roger Ineichen

On Thursday, August 9, 2012 5:38:29 PM UTC-4, projekt01 wrote:

Hi,

the following query returns the _id twice as list instead of the single _id
in fields

{
"query": {
"text_phrase_prefix": {
"aSearchName": {
"max_expansions": 10,
"analyzer": "default",
"query": "recruiter"
}
}
},
"fields": [
"_id",
"aSearchName"
]
}

The result from my elasticsearch connection
and also elastichead looks like:

{

  took: 9
  timed_out: false
  _shards: {
      total: 7
      successful: 7
      failed: 0
  }
  hits: {
      total: 1
      max_score: 0.9297228
      hits: [
          {
              _index: members
              _type: member
              _id: 501fc7117a93312324008d9f
              _score: 0.9297228
              fields: {
                  _id: [
                      501fc7117a93312324008d9f
                      501fc7117a93312324008d9f
                  ]
                  aSearchName: Recruiter RECRUITER, Bern
              }
          }
      ]
  }

}

The index mapping defines:
"_id": {"store": "yes"}

The elasticserver version is 0.19.4

Is this a known issue and solved in newer versions?

Mit freundlichem Gruss
Roger Ineichen


Projekt01 GmbH
www.projekt01.ch
Boesch 65
6331 Hünenberg
phone +41 (0)41 781 01 78
mobile +41 (0)79 340 52 32
fax +41 (0)41 781 00 78
email roger.i...@projekt01.ch <javascript:>


END OF MESSAGE

Created When _id field is stored and is present in the source, it is returned twice in the list of fields · Issue #2161 · elastic/elasticsearch · GitHub

On Friday, August 10, 2012 9:05:25 AM UTC-4, projekt01 wrote:

Hi Igor,

Betreff: Re: duplicated _id returned as list

I just tried it with master and it still works this way. Here is repro -
Repro for double id problem · GitHub

A possible workaround is to remove "_id" field from the source of the
document.

Ah thanks, didn't think about that. I was using the _id directly from the
hits dict
as a workarround.

Can you add an issue with you gist sample or should I add one?

Regards
Roger Ineichen

On Thursday, August 9, 2012 5:38:29 PM UTC-4, projekt01 wrote:

    Hi, 

    the following query returns the _id twice as list instead of the 

single _id

    in fields 

    { 
      "query": { 
        "text_phrase_prefix": { 
          "aSearchName": { 
            "max_expansions": 10, 
            "analyzer": "default", 
            "query": "recruiter" 
          } 
        } 
      }, 
      "fields": [ 
        "_id", 
        "aSearchName" 
      ] 
    } 

    The result from my elasticsearch connection 
    and also elastichead looks like: 

    { 

        took: 9 
        timed_out: false 
        _shards: { 
            total: 7 
            successful: 7 
            failed: 0 
        } 
        hits: { 
            total: 1 
            max_score: 0.9297228 
            hits: [ 
                { 
                    _index: members 
                    _type: member 
                    _id: 501fc7117a93312324008d9f 
                    _score: 0.9297228 
                    fields: { 
                        _id: [ 
                            501fc7117a93312324008d9f 
                            501fc7117a93312324008d9f 
                        ] 
                        aSearchName: Recruiter RECRUITER, Bern 
                    } 
                } 
            ] 
        } 

    } 

    The index mapping defines: 
    "_id": {"store": "yes"} 

    The elasticserver version is 0.19.4 

    Is this a known issue and solved in newer versions? 


    Mit freundlichem Gruss 
    Roger Ineichen 
    _____________________________ 
    Projekt01 GmbH 
    www.projekt01.ch 
    Boesch 65 
    6331 Hünenberg 
    phone   +41 (0)41 781 01 78 
    mobile   +41 (0)79 340 52 32 
    fax       +41 (0)41 781 00 78 
    email roger.i...@projekt01.ch <javascript:> 
    _____________________________ 
    END OF MESSAGE 

There isn't really a reason to store the _id, as its already stored as part
of the internal _uid and you always get it back as part of a hit response.
We should probably simply not allow to set store on the _id mapping.

On Friday, August 10, 2012 3:49:53 PM UTC+2, Igor Motov wrote:

Created When _id field is stored and is present in the source, it is returned twice in the list of fields · Issue #2161 · elastic/elasticsearch · GitHub

On Friday, August 10, 2012 9:05:25 AM UTC-4, projekt01 wrote:

Hi Igor,

Betreff: Re: duplicated _id returned as list

I just tried it with master and it still works this way. Here is repro

Repro for double id problem · GitHub

A possible workaround is to remove "_id" field from the source of the
document.

Ah thanks, didn't think about that. I was using the _id directly from the
hits dict
as a workarround.

Can you add an issue with you gist sample or should I add one?

Regards
Roger Ineichen

On Thursday, August 9, 2012 5:38:29 PM UTC-4, projekt01 wrote:

    Hi, 

    the following query returns the _id twice as list instead of 

the single _id

    in fields 

    { 
      "query": { 
        "text_phrase_prefix": { 
          "aSearchName": { 
            "max_expansions": 10, 
            "analyzer": "default", 
            "query": "recruiter" 
          } 
        } 
      }, 
      "fields": [ 
        "_id", 
        "aSearchName" 
      ] 
    } 

    The result from my elasticsearch connection 
    and also elastichead looks like: 

    { 

        took: 9 
        timed_out: false 
        _shards: { 
            total: 7 
            successful: 7 
            failed: 0 
        } 
        hits: { 
            total: 1 
            max_score: 0.9297228 
            hits: [ 
                { 
                    _index: members 
                    _type: member 
                    _id: 501fc7117a93312324008d9f 
                    _score: 0.9297228 
                    fields: { 
                        _id: [ 
                            501fc7117a93312324008d9f 
                            501fc7117a93312324008d9f 
                        ] 
                        aSearchName: Recruiter RECRUITER, Bern 
                    } 
                } 
            ] 
        } 

    } 

    The index mapping defines: 
    "_id": {"store": "yes"} 

    The elasticserver version is 0.19.4 

    Is this a known issue and solved in newer versions? 


    Mit freundlichem Gruss 
    Roger Ineichen 
    _____________________________ 
    Projekt01 GmbH 
    www.projekt01.ch 
    Boesch 65 
    6331 Hünenberg 
    phone   +41 (0)41 781 01 78 
    mobile   +41 (0)79 340 52 32 
    fax       +41 (0)41 781 00 78 
    email roger.i...@projekt01.ch <javascript:> 
    _____________________________ 
    END OF MESSAGE 

--

Hi kimchy

Betreff: Re: duplicated _id returned as list

There isn't really a reason to store the _id, as its already stored as
part of the internal
_uid and you always get it back as part of a hit response. We should
probably simply
not allow to set store on the _id mapping.

I often use the hits['fields'] with the pyhton API. It is nice
if the _id key/value whould be a part of this fields. It makes it
simpler to write code for data given from elasticsearch or mongodb.

Probably a good idea whould be not storing the _id , but merge the_id
key/value
into the fields result if asked for. This whould also be compatible with
previous
versions.

Regards
Roger Ineichen

On Friday, August 10, 2012 3:49:53 PM UTC+2, Igor Motov wrote:

Created When _id field is stored and is present in the source, it is returned twice in the list of fields · Issue #2161 · elastic/elasticsearch · GitHub
https://github.com/elasticsearch/elasticsearch/issues/2161

On Friday, August 10, 2012 9:05:25 AM UTC-4, projekt01 wrote:

  Hi Igor,

  > Betreff: Re: duplicated _id returned as list
  >
  > I just tried it with master and it still works this way.

Here is repro -

  > https://gist.github.com/3309993

https://gist.github.com/3309993

  >
  > A possible workaround is to remove "_id" field from the

source of the

document.

  Ah thanks, didn't think about that. I was using the _id

directly from the

hits dict
as a workarround.

  Can you add an issue with you gist sample or should I add

one?

  Regards
  Roger Ineichen

  > On Thursday, August 9, 2012 5:38:29 PM UTC-4, projekt01

wrote:

  >
  >         Hi,
  >
  >         the following query returns the _id twice as list

instead of the

single _id
> in fields
>
> {
> "query": {
> "text_phrase_prefix": {
> "aSearchName": {
> "max_expansions": 10,
> "analyzer": "default",
> "query": "recruiter"
> }
> }
> },
> "fields": [
> "_id",
> "aSearchName"
> ]
> }
>
> The result from my elasticsearch connection
> and also elastichead looks like:
>
> {
>
> took: 9
> timed_out: false
> _shards: {
> total: 7
> successful: 7
> failed: 0
> }
> hits: {
> total: 1
> max_score: 0.9297228
> hits: [
> {
> _index: members
> _type: member
> _id: 501fc7117a93312324008d9f
> _score: 0.9297228
> fields: {
> _id: [
> 501fc7117a93312324008d9f
> 501fc7117a93312324008d9f
> ]
> aSearchName: Recruiter
RECRUITER, Bern
> }
> }
> ]
> }
>
> }
>
> The index mapping defines:
> "_id": {"store": "yes"}
>
> The elasticserver version is 0.19.4
>
> Is this a known issue and solved in newer
versions?
>
>
> Mit freundlichem Gruss
> Roger Ineichen
> _____________________________
> Projekt01 GmbH
> www.projekt01.ch
> Boesch 65
> 6331 Hünenberg
> phone +41 (0)41 781 01 78
> mobile +41 (0)79 340 52 32
> fax +41 (0)41 781 00 78
> email roger.i...@projekt01.ch <javascript:>
> _____________________________
> END OF MESSAGE
>
>
>
>
>

--

--

Thats not the format of how elasticsearch works, the _id has its own section, not within the fields.

On Aug 9, 2012, at 11:38 PM, Roger dev@projekt01.ch wrote:

Hi,

the following query returns the _id twice as list instead of the single _id
in fields

{
"query": {
"text_phrase_prefix": {
"aSearchName": {
"max_expansions": 10,
"analyzer": "default",
"query": "recruiter"
}
}
},
"fields": [
"_id",
"aSearchName"
]
}

The result from my elasticsearch connection
and also elastichead looks like:

{

took: 9
timed_out: false
_shards: {
total: 7
successful: 7
failed: 0
}
hits: {
total: 1
max_score: 0.9297228
hits: [
{
_index: members
_type: member
_id: 501fc7117a93312324008d9f
_score: 0.9297228
fields: {
_id: [
501fc7117a93312324008d9f
501fc7117a93312324008d9f
]
aSearchName: Recruiter RECRUITER, Bern
}
}
]
}

}

The index mapping defines:
"_id": {"store": "yes"}

The elasticserver version is 0.19.4

Is this a known issue and solved in newer versions?

Mit freundlichem Gruss
Roger Ineichen


Projekt01 GmbH
www.projekt01.ch
Boesch 65
6331 Hünenberg
phone +41 (0)41 781 01 78
mobile +41 (0)79 340 52 32
fax +41 (0)41 781 00 78
email roger.ineichen@projekt01.ch


END OF MESSAGE

--