Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Bulk API ignores the specified ingest pipeline in the bulk item #12854

Closed
gaobinlong opened this issue Mar 22, 2024 · 1 comment
Closed
Labels
bug Something isn't working ingest-pipeline v2.14.0 v3.0.0 Issues and PRs related to version 3.0.0

Comments

@gaobinlong
Copy link
Collaborator

Describe the bug

When diving deep on this issue, I found a new issue in bulk API, when there's a specified ingest pipeline in the update action with upsert, the pipeline will not be executed, which should be a bug.

Related component

Indexing

To Reproduce

  1. Create an ingest pipeline
PUT _ingest/pipeline/test_pipeline
{
  "processors": [
    {
      "set": {
        "field": "z",
        "value": 100
      }
    }]
}
  1. Bulk update with upsert, the document with ID 1 doesn't exist
POST /_bulk
{"update":{"_index":"test1","_id":"1", "pipeline":"test_pipeline"}}
{"upsert":{"x":3,"y":5},"script":{"source":"ctx._source.x += 1"}}
  1. Get the document :
    Get test1/_doc/1
    the result is:
{
  "_index": "test1",
  "_id": "1",
  "_version": 1,
  "_seq_no": 0,
  "_primary_term": 1,
  "found": true,
  "_source": {
    "x": 3,
    "y": 5
  }
}

, we can see that the document doesn't contain the field z which is set by the ingest pipeline. But if we set the ingest pipeline in the create action, it works well:

POST /_bulk
{"create":{"_index":"test1","_id":"1", "pipeline":"test_pipeline"}}
{"x":3,"y":5}

, the result is:

{
  "_index": "test1",
  "_id": "1",
  "_version": 1,
  "_seq_no": 0,
  "_primary_term": 1,
  "found": true,
  "_source": {
    "x": 3,
    "y": 5,
    "z": 100
  }
}

Expected behavior

Bulk API should resolve the ingest pipeline specified in the update action with upsert.

Additional Details

Host/Environment (please complete the following information):

  • OS: [MacOS]
  • Version [3.0.0]
@gaobinlong gaobinlong added bug Something isn't working untriaged labels Mar 22, 2024
@github-actions github-actions bot added the Indexing Indexing, Bulk Indexing and anything related to indexing label Mar 22, 2024
@vikasvb90 vikasvb90 added ingest-pipeline and removed Indexing Indexing, Bulk Indexing and anything related to indexing labels Mar 27, 2024
@reta reta added v3.0.0 Issues and PRs related to version 3.0.0 v2.14.0 and removed untriaged labels Apr 3, 2024
@gaobinlong
Copy link
Collaborator Author

Closed by #12883.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ingest-pipeline v2.14.0 v3.0.0 Issues and PRs related to version 3.0.0
Projects
Status: No status
Development

No branches or pull requests

3 participants