# Phrase suggester on nexted fields

**URL:** <https://discuss.elastic.co/t/phrase-suggester-on-nexted-fields/85405>\
**Category:** Elasticsearch\
**Created:** [May 11, 2017, 1:13pm UTC](https://discuss.elastic.co/t/phrase-suggester-on-nexted-fields/85405 "2017-05-11T13:13:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gianni\_Livolsi](https://avatars.discourse-cdn.com/v4/letter/g/41988e/32.png) [@Gianni\_Livolsi](https://discuss.elastic.co/u/Gianni_Livolsi)\
**Post date:** [May 11, 2017, 1:13pm UTC](https://discuss.elastic.co/t/phrase-suggester-on-nexted-fields/85405/1 "2017-05-11T13:13:55Z")

</div>

I'm trying to make a phrase suggester, i need use as field the content field of a nested object  
Using attachment.content i've no hits instead using info.receivedfrom i get suggestions, so i think that is a problem related to nested object, is it supported...???  
If yes how must do it ..??

Tnx

Below my mapping

```
  {
       "mytest": {
          "mappings": {
             "doc": {
                "properties": {
                   "info": {
                      "properties": {
                         "receivedfrom": {
                            "type": "text"
                         }
                      }
                   },
                   "attachments": {
                      "type": "nested",
                      "include_in_all": true,
                      "properties": {
                         "content": {
                            "type": "text"
                         },
                         "data": {
                            "type": "text"
                         },
                         "filename": {
                            "type": "keyword"
                         },
                         "mimetype": {
                            "type": "keyword"
                         }
                      }
                   }
                }
             }
          }
       }
    }

```

next my query

```
POST mytest/_search
{
  "suggest":{
    "text" : "my phrase",
    "my-suggest":{
      "phrase":{
        "field":"attachments.content",
        "gram_size":3
      }
    }
  }
}
```

---

<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:** [June 8, 2017, 1:23pm UTC](https://discuss.elastic.co/t/phrase-suggester-on-nexted-fields/85405/2 "2017-06-08T13:23:04Z")

</div>

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