# SearchUI query nested field

**URL:** <https://discuss.elastic.co/t/searchui-query-nested-field/370086>\
**Category:** Elastic Search\
**Created:** [November 5, 2024, 4:40pm UTC](https://discuss.elastic.co/t/searchui-query-nested-field/370086 "2024-11-05T16:40:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike\_vogel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mike_vogel/32/138978_2.png) [@mike\_vogel](https://discuss.elastic.co/u/mike_vogel)\
**Post date:** [November 5, 2024, 4:40pm UTC](https://discuss.elastic.co/t/searchui-query-nested-field/370086/1 "2024-11-05T16:40:34Z")

</div>

When using the React SearchUI how is the config setup to search a nested field created by using the attachment processor? Searching for "attachment.title" works in the console. In the SearchUI config I've tried title and "attachment.title" as shown in the example below but the result displayed is the attachment object as: attachment[object Object] .

```auto
const config = {
  searchQuery: {
    search_fields: {
      "attachment.title": {
        weight: 3
      },
      "language": {},
    },
    result_fields: {
      "attachment.title": {
        snippet: {}
      },
      "language": {}
    },

Query at console for a nested feild that works:

GET slr-test/_search
{
  "_source": ["attachment.title"],  
  "query": {
    "match_all": {}
  }
}

```

It returns:

```auto
{
  "took": 0,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 2,
      "relation": "eq"
    },
    "max_score": 1,
    "hits": [
      {
        "_index": "slr-test",
        "_id": "CAO6_JIBjabE2jgYaldN",
        "_score": 1,
        "_ignored": [
          "attachment.content.keyword"
        ],
        "_source": {
          "attachment": {
            "title": "JDR_4126995 1..10"
          }
        }
      },
      {
        "_index": "slr-test",
        "_id": "CQPy_JIBjabE2jgYDVe-",
        "_score": 1,
        "_ignored": [
          "attachment.content.keyword"
        ],
        "_source": {
          "attachment": {
            "title": "JDR_4126995 1..10"
          }
        }
      }
    ]
  }
}

```

---

<div class="post-metadata">

**Author:** ![mike\_vogel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mike_vogel/32/138978_2.png) [@mike\_vogel](https://discuss.elastic.co/u/mike_vogel)\
**Post date:** [November 5, 2024, 5:39pm UTC](https://discuss.elastic.co/t/searchui-query-nested-field/370086/2 "2024-11-05T17:39:00Z")

</div>

I just found this: [Known issues | Documentation](https://www.elastic.co/docs/current/search-ui/known-issues)

- When using the **Elasticsearch connector** Search UI does not render nested objects.

I changed my ingestion process to use the 'set' processor to copy the nested fields to top-level fields. Is there a better workaround?

---

<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:** [December 3, 2024, 5:39pm UTC](https://discuss.elastic.co/t/searchui-query-nested-field/370086/3 "2024-12-03T17:39:56Z")

</div>

Closed on December 3, 2024, 5:39pm UTC

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