# Nested filter query issue

**URL:** <https://discuss.elastic.co/t/nested-filter-query-issue/20332>\
**Category:** Elasticsearch\
**Created:** [October 20, 2014, 9:20am UTC](https://discuss.elastic.co/t/nested-filter-query-issue/20332 "2014-10-20T09:20:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shekhar\_chauhan](https://avatars.discourse-cdn.com/v4/letter/s/46a35a/32.png) [@shekhar\_chauhan](https://discuss.elastic.co/u/shekhar_chauhan)\
**Post date:** [October 20, 2014, 9:20am UTC](https://discuss.elastic.co/t/nested-filter-query-issue/20332/1 "2014-10-20T09:20:41Z")

</div>

Hi All,  
I am working on nested filter query.But this query is searching only on  
nested object properties of type int ,double,date.But not searching when  
the properties of string type.  
My document structure is given below-

"sectionResults": [  
{  
"SectionName": "Project Details",  
"itemResults": [  
{  
"InspectionItem": "Project Id",

```
               "Value": "asd",
               "NumericValue": 0,
               "DoubleValue": 1,
               "LongValue": 0,
               "DateValue": "2014-10-08T00:00:00"
           }

        ]

   }

```

]

and my query is -

{

"query": {

```
"filtered": {

  "query": {

    "match_all": {}

  },

  "filter": {

    "nested": {

      "path": "sectionResults.itemResults",

      "filter": {

        "bool": {

          "must": [ 

            {

              "range": {

                "sectionResults.itemResults.DateValue": {

                  "from": "2014-10-01",

                  "to": "2014-10-08"

                }

              }

            },

            {

              "term": {

                "sectionResults.itemResults.InspectionItem": "Project Id"

              }

            }

          ]

        }

      },

      "_cache": true

    }

    }

  }

}

```

}

For Example - If i do search on InspectionItem Property of itemResults.then result found is 0.But gives reults in case of DateValue,DoubleValue properties of object itemResults .Please help.

Thanks in advance,

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/8688c1c4-8111-41e2-af4d-ad2e47295ad6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8688c1c4-8111-41e2-af4d-ad2e47295ad6%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:55am UTC](https://discuss.elastic.co/t/nested-filter-query-issue/20332/2 "2017-07-06T00:55:06Z")

</div>

Closed on July 6, 2017, 12:55am UTC


