# Query and/or access object property

**URL:** <https://discuss.elastic.co/t/query-and-or-access-object-property/216472>\
**Category:** Elasticsearch\
**Created:** [January 24, 2020, 5:35pm UTC](https://discuss.elastic.co/t/query-and-or-access-object-property/216472 "2020-01-24T17:35:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![styxtb1598](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@styxtb1598](https://discuss.elastic.co/u/styxtb1598)\
**Post date:** [January 24, 2020, 5:35pm UTC](https://discuss.elastic.co/t/query-and-or-access-object-property/216472/1 "2020-01-24T17:35:23Z")

</div>

I'm very new to ES and using the API for searching. I have an set of logs that have an object's properties  
 ![Annotation 2020-01-24 113124](https://us1.discourse-cdn.com/elastic/original/3X/e/3/e3e65ae9f9547767ff8af6596e7e1950791ba4e8.png)

In my c# query, I am trying to access the fields.ui.Message field. How can I do that? I get the top level stuff (ID, messageTemplate, etc) and a Fields object. Below is the search itself.

```
var searchResponse = await _client.SearchAsync<TaskLog>(s => s
            .Source(sf => sf
               .Includes(i => i
                  .Fields("*.ui.Message*")
               )
            )
          .Index(_taskLogConfig.Index)
          .Size(_taskLogConfig.RetrieveCount)
          .Query(q => q
              .QueryString(qs => qs
                  .Fields(f => f.Field("fields.ui.TaskId")).Query(request.TaskId.ToString())
              )
          )
        .Sort(sa => sa.Descending(u => u.Timestamp)), cancellationToken
      );
```

---

<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:** [February 21, 2020, 5:35pm UTC](https://discuss.elastic.co/t/query-and-or-access-object-property/216472/2 "2020-02-21T17:35:27Z")

</div>

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