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

Example in documentation for _parent fails #17935

Closed
fsparv opened this issue Apr 22, 2016 · 3 comments
Closed

Example in documentation for _parent fails #17935

fsparv opened this issue Apr 22, 2016 · 3 comments

Comments

@fsparv
Copy link

fsparv commented Apr 22, 2016

Elasticsearch version:2.3.1

JVM version:
java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)

OS version:
Linux customerhostname 3.10.0-327.10.1.el7.x86_64 #1 SMP Tue Feb 16 17:03:50 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Description of the problem including expected versus actual behavior: Following the documentation on https://www.elastic.co/guide/en/elasticsearch/reference/2.3/mapping-parent-field.html I get a 400 error in sense for the second PUT, following it in FireFox RestClient (using POST not GET as per https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-body.html), I get no results for the final has_child query.

Steps to reproduce:

  1. Install elastic, single node, default everything
  2. Apply mapping and add data as shown on https://www.elastic.co/guide/en/elasticsearch/reference/2.3/mapping-parent-field.html
  3. Issue query shown at https://www.elastic.co/guide/en/elasticsearch/reference/2.3/mapping-parent-field.html

Expected result: One my_parent document should be returned (even if further parent docs are added)...

Actual result: No documents are ever returned by any "has_child" query, including a match all query such as:

POST my_index/my_parent/_search?routing=_id
{
  "query": {
    "has_child": { 
      "type": "my_child",
      "query": { "match_all": {} }
    }
  }
}

Running queries with a GET line in Sense (after posting the docs with RestClient due to aforementioned 400 error) also does not work.

@cbuescher
Copy link
Member

cbuescher commented Apr 25, 2016

I tried this, the problem seems to be when copy/pasting the example, there is a trailing white space in the PUT url for the child documents. This seems to trip the parsing of the url parameters. After removing the trailing whitespaces, the example otherwise seems to be okay. I wonder if Sense should trim trailing whitespaces by default.

@girirajsharma
Copy link
Contributor

@cbuescher I also tried it and concluded the same.

@clintongormley
Copy link
Contributor

Closed in favour of elastic/sense#136

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants