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

Size parameter is ignored for filtered query that includes geo_polygon filter #5370

Closed
wizardz opened this issue Mar 9, 2014 · 1 comment

Comments

@wizardz
Copy link

wizardz commented Mar 9, 2014

Query

{
  "query": {
    "filtered": {
      "query": {
        "match_all": {}
      },
      "filter": {
        "geo_polygon": {
          "coordinate": {
            "points": {
              "points": [
                [
                  -84.293222919922,
                  33.865223592668
                ],
                [
                  -84.293222919922,
                  33.632776407332
                ],
                [
                  -84.482737080078,
                  33.632776407332
                ],
                [
                  -84.482737080078,
                  33.865223592668
                ],
                [
                  -84.293222919922,
                  33.865223592668
                ]
              ]
            }
          }
        }
      }
    }
  },
  "size": 2
}

always returns 10 results and does not consider "size" parameter.

To compare:

{
  "query": {
    "filtered": {
      "query": {
        "match_all": {}
      },
      "filter": {
        "match_all": {}
      }
    }
  },
  "size": "2"
}

returns 2 results.

MacOS, elastic search version: 1.0.1 (tested with 0.18), lucene_version: 4.6

bleskes added a commit to bleskes/elasticsearch that referenced this issue Mar 9, 2014
@bleskes
Copy link
Contributor

bleskes commented Mar 9, 2014

you have an extra points wrapper at

  "coordinate": {
            "points": {
              "points": [

If you only have the array one it should good. I've going to improve the error reporting in this case.

@bleskes bleskes closed this as completed Mar 9, 2014
bleskes added a commit that referenced this issue Mar 10, 2014
bleskes added a commit that referenced this issue Mar 10, 2014
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

2 participants