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

Kibana Dev Console: GET <index>/_doc/<id> request with payload create/updates document #77276

Closed
pladdy opened this issue Sep 11, 2020 · 2 comments
Labels
bug Fixes for quality problems that affect the customer experience Feature:Console Dev Tools Console Feature Feature:Dev Tools Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more

Comments

@pladdy
Copy link

pladdy commented Sep 11, 2020

Kibana version:

6.5.4

Elasticsearch version:

6.5.4

Server OS version:

linux/amd64 (running on docker)

Browser version:

Mozilla 80.0

Browser OS version:

Mac osCatalina 10.15.06

Original install method (e.g. download page, yum, from source, etc.):

I used a docker-compose file to run a 6.5.4 elasticsearch (single-node) and kibana (same version). Provided below in steps to reproduce.

Describe the bug:

While using _explain on a search and document to explore how it matched, I arrived at a point where I wanted to GET the document in question and look at it. Here's an example search I ran in the dev console:

GET /new-index/_doc/0/_explain
{
  "query": {
    "query_string": {
      "query": "*"
    }
  }
}

Since I wanted to look at doc 0, I simply removed _explain from the end of the request in Kibana, but I left the payload.

GET /new-index/_doc/0
{
  "query": {
    "query_string": {
      "query": "*"
    }
  }
}

The response surprised me:

{
  "_index" : "new-index",
  "_type" : "_doc",
  "_id" : "0",
  "_version" : 2,
  "result" : "updated",
  "_shards" : {
    "total" : 2,
    "successful" : 1,
    "failed" : 0
  },
  "_seq_no" : 4,
  "_primary_term" : 1
}

Although I did a GET request, it seems it ended up behaving like a PUT request.

I tried to reproduce this against ES via it's GET API but it would not update the doc.

Steps to reproduce:

  1. create the following docker-compose.yml
version: "2.4"

services:
  elasticsearch:
    image: elasticsearch:6.5.4
    environment:
      - cluster.name=es-test-cluster
      - "ES_JAVA_OPTS=-Xms256m -Xmx256m"
      - discovery.type=single-node
      - network.bind_host=0.0.0.0
    ports:
      - 9200:9200
    networks:
      - es-single-net

  kibana:
    image: kibana:6.5.4
    container_name: kibana
    environment:
      ELASITCSEARCH_URL: http://elasticsearch:9200
    ports:
      - 5601:5601
    networks:
      - es-single-net

volumes:
  esdata1:
    driver: local
  esdata2:
    driver: local

networks:
  es-single-net:
  1. run docker-compose up --deatch

  2. once up, in your browser, go to http://localhost:5601/app/kibana#/dev_tools/console?_g=()

  3. Run these in kibana dev console and you'll create a document with a GET

PUT /new-index

GET /new-index/_doc/0
{
  "query": {
    "query_string": {
      "query": "*"
    }
  }
}

Expected behavior:

A response that indicates doc is not found:

{
  "_index" : "new-index",
  "_type" : "_doc",
  "_id" : "0",
  "found" : false
}

Screenshots (if relevant):

n/a ; I can provide if helpful

Errors in browser console (if relevant):

n/a

Provide logs and/or server output (if relevant):

n/a

Any additional context:

n/a

I tried looking to see if this was documented/known behavior but couldn't find anything. Thank you for reading and considering.

@afharo afharo added bug Fixes for quality problems that affect the customer experience Feature:Console Dev Tools Console Feature v6.5.4 labels Sep 14, 2020
@cjcenizal cjcenizal added Feature:Dev Tools Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more and removed v6.5.4 labels Sep 30, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui (Team:Elasticsearch UI)

@cjcenizal
Copy link
Contributor

This was fixed in 7.5.0 via #46200

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Console Dev Tools Console Feature Feature:Dev Tools Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Projects
None yet
Development

No branches or pull requests

4 participants