sirensolutions / siren-join

[This is the old, single node version for Elasticsearch 2.x, see the latest "Siren Federate" plugin for distributed Elasticsearch 5.x and 6.x capabilities]

Home Page:http://siren.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Suppressing query parsing errors in filterjoin query

fabiocorneti opened this issue · comments

The script below creates two indices and executes a filterjoin having a terms query with an invalid value for the name parameter; is the error in the query suppressed by design?

#!/bin/bash
ES=http://localhost:9200

curl -XDELETE $ES/places
curl -XDELETE $ES/people
curl -XPUT $ES/places
curl -XPUT $ES/people
curl -XPUT $ES/people/_mappings/person -d '{"person": {"properties": {"name": {"type": "string", "index": "not_analyzed"}, "city": {"type": "string", "index": "not_analyzed"}}}}'
curl -XPUT $ES/places/_mappings/city -d '{"city": {"properties": {"name": {"type": "string", "index": "not_analyzed"}}}}'
curl -XPOST $ES/people/person/luke -d '{"name": "Jack Foo", "city": "Rome"}'
curl -XPOST $ES/people/person/anakin -d '{"name": "John Bar", "city": "Prague"}'
curl -XPOST $ES/places/city/Prague -d '{"name": "Prague"}'
curl -XPOST $ES/places/city/Rome -d '{"name": "Rome"}'

# Search for people in Rome using a terms query with an invalid parameter value; response code is 200
curl -v -XPOST $ES/people/person/_coordinate_search?pretty -d '{
  "filter": {
    "filterjoin": {
      "city": {
        "indices": ["places"],
        "types": ["city"],
        "path": "name",
        "query": {
          "terms": {
            "name": "Rome"
          }
        }
      }
    }
  }
}'

# Standalone query fails
curl -XPOST $ES/places/city/_coordinate_search?pretty -d '{
  "query": {
    "terms": {
      "name": "Rome"
    }
  }
}'

yes, looks like errors on the first phase of the query (terms query) is not reported back up to the coordinator properly.