# NEST - Don't index certain values with bulk requests

**URL:** <https://discuss.elastic.co/t/nest-dont-index-certain-values-with-bulk-requests/48351>\
**Category:** Elasticsearch\
**Created:** [April 25, 2016, 9:00pm UTC](https://discuss.elastic.co/t/nest-dont-index-certain-values-with-bulk-requests/48351 "2016-04-25T21:00:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![karlr](https://avatars.discourse-cdn.com/v4/letter/k/13edae/32.png) [@karlr](https://discuss.elastic.co/u/karlr)\
**Post date:** [April 25, 2016, 9:00pm UTC](https://discuss.elastic.co/t/nest-dont-index-certain-values-with-bulk-requests/48351/1 "2016-04-25T21:00:48Z")

</div>

I have a class that represents the data I want to store in ES that contains mostly integers. However, I don't want to index fields which are a particular value (in this case, 0). I'm trying to get the API to completely disregard fields that are 0 so they don't get indexed.

Currently I'm doing this, but it doesn't work (the zeroes are indexed anyway):

```
class ElasticDataRepresentation
{
        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
        [Nest.Number(Name = "postid", NullValue = 0)]
        public uint PostID { get; set; }

        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
        [Nest.Number(Name = "datapointid", NullValue = 0)]
        public int DataPointID { get; set; }
}

```

and then run the indexing in bulk with the following code. Everything works as expected except that I can't get it to disregard the zeroes:

```
var descriptor = new Nest.BulkDescriptor();
foreach (var pi in items)
{
    //Construct the ID
    string id = pi.DataPointID.ToString() + "_" + pi.PostID;
    //Add this document to the bulk request
    descriptor.Index<ElasticDataRepresentation>(op => op.Document(pi).Id(id).Index(Model.ElasticSearchIndexName).Type(Model.ElasticSearchTypeName));

}

//Execute the bulk index request
var result = client.Bulk(descriptor);

```

Any ideas how this can be resolved? Thanks!

---

<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 5, 2017, 10:56pm UTC](https://discuss.elastic.co/t/nest-dont-index-certain-values-with-bulk-requests/48351/2 "2017-07-05T22:56:25Z")

</div>


