Hi,
I'm trying to apply a nested filter on a document but, for when I filter specifically by one of the nested attributes, I always get 0 results. For example, with a mapping like:
"PARTNER": {
   "properties": {
        "Addresses": {
             "properties": {
                    "CountyCode": {
                             "type": "string"
                    },
                    "EntityCode": {
                        "type": "string"
                    }, [...]
               }
        }, "type": "nested"
     }, [...]
}
I'm able to perform a filter on the CountyCode attribute, but if I filter on the EntityCode, i always get zero results:
{
  "from": 0,
  "size": 10,
  "query": {
    "filtered": {
      "query": {
        "bool": {
          "must": {
            "match_all": {}
          }
        }
      },
      "filter": {
        "nested": {
          "filter": {
            "bool": {
              "must": {
                "query": {
                  "query_string": {
                    "query": "*",
                    "fields": [
                      "EntityCode"
                    ]
                  }
                }
              }
            }
          },
          "path": "Addresses"
        }
      }
    }
  }
}
That query gets zero results, if I replace the field with CountyCode, it gives me proper results.
I'm performing the queries on the web-based console, on ES 1.4.2,.
The nested documents have the format:
{
    "CountyCode": "516",
    "EntityCode": "203",
    [...]
}
Any idea on why that one field returns nothing ?
Thanks!
