Question: I use Elasticsearch terms aggregation to see how many documents have a certain value in their "foo" field like this:

```
{
    ...
    "aggregations": {
        "metastore": { 
            "terms": { 
                "field": "foo",
                "size": 50 
            }
        }
    }
}

```

and I get the response:

```
 "aggregations": {
      "foo": {
            "buckets": [
                {
                    "key_as_string": "2018-10-01T00:00:00.000Z",
                    "key": 1538352000000,
                    "doc_count": 935
                },
                {
                    "key_as_string": "2018-11-01T00:00:00.000Z",
                    "key": 1541030400000,
                    "doc_count": 15839
                },
                ...
                /* 48 more values */
             ]
      }
 }

```

But I'm limiting the number of different values to 50. If there are more different values in this field they won't be returned in the response, and that's fine, because I don't need to all of them, but I would like to know how many of them there are. So, how could I get the total number of different values? It would be fantastic if the answer provided a full example query, thanks.

Answer: 
The way that `@Parcelize` works is that it only serializes/deserializes the properties in the primary constructor. You've only declared properties `a`, `b` and `c` in the primary constructor. Therefore, the compiler will only insert the values of `a`, `b` and `c` into the generated `Parcel` and, of course, only these values will be unmarshalled at the receiving end.

You need to add the other properties to your primary constructor, or implement the `Parcelable` interface yourself instead of using `@Parcelize`.

See <https://joaoalves.dev/posts/kotlin-playground/parcelable-in-kotlin-here-comes-parcelize/>

See also this [question](https://stackoverflow.com/questions/33551972/is-there-a-convenient-way-to-create-parcelable-data-classes-in-android-with-kotl) and the various suggestions in the answers
> 
> @Parcelize requires all serialized properties to be declared in the primary constructor. The plugin issues a warning on each property with a backing field declared in the class body. Also, you can't apply @Parcelize if some of the primary constructor parameters are not properties.
> 
> 
> 

From <https://developer.android.com/kotlin/parcelize>
You must move e, f, and g variable declaration to primary constructor
Your model code can be like this:

```kotlin
@Parcelize
data class SendData(var a: Int, var b: String, var c: String, var e: Int? = null, var f: String? = null, var g: Int? = null) : Parcelable { 
    var isClicked = false

    override fun toString(): String{
        return JsonUtil.toJson(this) // custom util
    }
}

```