# About QueryContainerDescriptor function

**URL:** <https://discuss.elastic.co/t/about-querycontainerdescriptor-function/291103>\
**Category:** Elasticsearch\
**Created:** [December 7, 2021, 9:22am UTC](https://discuss.elastic.co/t/about-querycontainerdescriptor-function/291103 "2021-12-07T09:22:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Suki\_Yua](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suki_yua/32/98464_2.png) [@Suki\_Yua](https://discuss.elastic.co/u/Suki_Yua)\
**Post date:** [December 7, 2021, 9:22am UTC](https://discuss.elastic.co/t/about-querycontainerdescriptor-function/291103/1 "2021-12-07T09:22:42Z")

</div>

Hi

I have a search document as below

```auto
{
  "total": 1,
  "results": [
    {
      "id": 1346282,
      "studentname": "Casey",
      "studentnumber" :"YT2021"
      "favourbooks": [
        {
             "id": 1,
             "bookname":"Three Little Pig",
             "AuthorName":"Steven Kellogg"
        },
        {
             "id": 2,
             "bookname":"Winnie The Pooh",
             "AuthorName":"A. A. Milne"
        }
      ]
    }
}

```

and I define student number filtering as below code is work

```auto
var filters = new List<Func<QueryContainerDescriptor<StudentDocument>, QueryContainer>>();
filters.Add(fq => fq.Terms(t => t.Field(f => f.studentnumber).Terms(request.studentnumber)));

```

But I don't know how to filterthe favourbooks which favourbooks is sub list of student  
can anyone advise ?

Thank you

---

<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:** [January 4, 2022, 9:22am UTC](https://discuss.elastic.co/t/about-querycontainerdescriptor-function/291103/2 "2022-01-04T09:22:52Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
