# Suggester -Fields inside Payload vs regular fields

**URL:** <https://discuss.elastic.co/t/suggester-fields-inside-payload-vs-regular-fields/23115>\
**Category:** Elasticsearch\
**Created:** [April 6, 2015, 11:40pm UTC](https://discuss.elastic.co/t/suggester-fields-inside-payload-vs-regular-fields/23115 "2015-04-06T23:40:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ap1](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@Ap1](https://discuss.elastic.co/u/Ap1)\
**Post date:** [April 6, 2015, 11:40pm UTC](https://discuss.elastic.co/t/suggester-fields-inside-payload-vs-regular-fields/23115/1 "2015-04-06T23:40:44Z")

</div>

I need to create a Search Suggester on text and return an object with bunch  
of fields.

The object contains the following fields:  
userId, name, x,y,z,a,b,c

_Search needs to be done only on 2 fields - Name & Text._

I also need to return the Object(with fields) if the docId is explicitly  
requested.  
curl -XGET '[http://localhost:9200/twitter/tweet/1](http://localhost:9200/twitter/tweet/1)'

_Question_ : Should everything in the Object (that needs to be returned) go  
in the payload only \*(Option 2) \*or payload+regular fields _(Option 1)_ ?

\*Option 1: \*  
json = {  
"suggest" : {  
"input": ["US"],  
"output": "US",

- 

```
     "payload" : {*
            *"userId" : "OID123", "name" : "US", "text" : 

```

"California", ... \< list of fields\>\*

- 

```
       }*
  }

```

}

\*Option 2: \*  
json = {  
_"userId" : "OID123", "name" : "US", "text" : "California", ... \<  
list of fields\>_  
"suggest" : {  
"input": ["abc"],  
"output": "abc",

- 

```
     "payload" : {*
            *"userId" : "OID123", "name" : "US", "text" : 

```

"California", ... \< list of fields\>\*

- 

```
       }*
  }

```

}

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/ca263ca6-b22f-4a60-bfef-a68c6c39d4a2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ca263ca6-b22f-4a60-bfef-a68c6c39d4a2%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 12:21am UTC](https://discuss.elastic.co/t/suggester-fields-inside-payload-vs-regular-fields/23115/2 "2017-07-06T00:21:20Z")

</div>


