Skip to content
New issue

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

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

Already on GitHub? # to your account

Nested query with bool doesn't work when there is only one MUST condition. #32

Closed
saimaz opened this issue Oct 28, 2015 · 1 comment
Closed
Assignees
Labels

Comments

@saimaz
Copy link
Member

saimaz commented Oct 28, 2015

$bool = new BoolQuery();
$bool->add(new MatchQuery('some.field', 'someValue'), BoolQuery::MUST);

$nested = new NestedQuery('urls', $bool);

Will produce:

{
  "nested": {
    "path": "urls",
    "query": {
      "bool": {
        "match": {
          "some.field": {
            "query": "someValue"
          }
        }
      }
    }
  }
}

Missing must condition inside bool...

@trandangtri
Copy link
Contributor

I fixed this bug and added more 2 test-cases also. Please take a look on this.

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

No branches or pull requests

3 participants