Skip to content

Indexing: Using _id as object doesnt work for future queries #6514

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

Closed
spinscale opened this issue Jun 16, 2014 · 1 comment
Closed

Indexing: Using _id as object doesnt work for future queries #6514

spinscale opened this issue Jun 16, 2014 · 1 comment

Comments

@spinscale
Copy link
Contributor

Hey,

had to describe the issue in one line, here is the possibiltiy to reproduce

DELETE campaigns
PUT campaigns
{
   "mappings" : {
      "campaign" : {
         "properties" : {
            "location" : {
                "type": "geo_shape",
                "tree": "quadtree"
            }
         }
      }
   }
}

POST /campaigns/campaign/1
{
  "location" : {
      "type" : "circle",
      "coordinates" : [45.01, 2.26],
      "radius" : "9000m"
  }
}

POST campaigns/campaign/
{
  "_id": { "c_id": "1891"},
  "location" : {
      "type" : "circle",
      "coordinates" : [45.01, 2.26],
      "radius" : "9000m"
  }
}

GET campaigns/campaign/_search

GET campaigns/campaign/_search
{
    "query":{
        "filtered": {
            "query": {
                "match_all": {}
            },
            "filter": {
                "geo_shape": {
                    "location": {
                   "relation": "intersects",
                        "shape": {
                            "type": "circle",
                            "coordinates" : [45.01001, 2.26],
                            "radius":"1m"
                        }
                    }
                }
            }
        }
    }
}

You can see the difference between match all and the geo shape query, even though the points are the same. If you remove the _id field from the document, everything works, so maybe the IdFieldMapper throws an Exception (rightfully, as an id cannot be an object) and then the rest of the document is not indexed.

If you replace the _id object with a string, you get an exception, that the id values dont match as one ID is autogenerated. Not sure, if this is the desired behaviour.

@clintongormley
Copy link
Contributor

We should not try to parse the _id field inside the document. Duplicate of #6730

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