Phrase suggester on nexted fields


(Gianni Livolsi) #1

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
      }
    }
  }
}

(system) #2

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