Skip to content

Doc value get indexed into the wrong document #29565

@jpountz

Description

@jpountz

This issue was reported at https://discuss.elastic.co/t/issue-storing-binary-fields-in-6-2-2/128290 against 6.2 but it also reproduces against master.

Here is a recreation. All documents report the same value in their doc-value field: the value of the last document in the bulk request.

PUT blob_test
{
  "settings": {
    "number_of_shards": 1,
    "number_of_replicas": 0
  }, 
  "mappings": {
    "_doc": {
      "properties": {
        "blob": {
          "type": "binary",
          "doc_values": true
        }
      }
    }
  }
}

POST blob_test/_doc/_bulk
{ "index": { "_id": "id_0" } }
{ "blob": "aWRfMCBhbmQgc29tZSB0ZXh0" }
{ "index": { "_id": "id_1" } }
{ "blob": "aWRfMSBhbmQgc29tZSB0ZXh0" }
{ "index": { "_id": "id_2" } }
{ "blob": "aWRfMiBhbmQgc29tZSB0ZXh0" }
{ "index": { "_id": "id_3" } }
{ "blob": "aWRfMyBhbmQgc29tZSB0ZXh0" }
{ "index": { "_id": "id_4" } }
{ "blob": "aWRfNCBhbmQgc29tZSB0ZXh0" }
{ "index": { "_id": "id_5" } }
{ "blob": "aWRfNSBhbmQgc29tZSB0ZXh0" }
{ "index": { "_id": "id_6" } }
{ "blob": "aWRfNiBhbmQgc29tZSB0ZXh0" }
{ "index": { "_id": "id_7" } }
{ "blob": "aWRfNyBhbmQgc29tZSB0ZXh0" }
{ "index": { "_id": "id_8" } }
{ "blob": "aWRfOCBhbmQgc29tZSB0ZXh0" }
{ "index": { "_id": "id_9" } }
{ "blob": "aWRfOSBhbmQgc29tZSB0ZXh0" }


GET blob_test/_search 
{
  "docvalue_fields": ["blob"]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Search/SearchSearch-related issues that do not fall into other categories>bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions