# Excluding properties of a type in NEST

**URL:** <https://discuss.elastic.co/t/excluding-properties-of-a-type-in-nest/48006>\
**Category:** Elasticsearch\
**Created:** [April 21, 2016, 8:50am UTC](https://discuss.elastic.co/t/excluding-properties-of-a-type-in-nest/48006 "2016-04-21T08:50:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dan\_Matthews](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@Dan\_Matthews](https://discuss.elastic.co/u/Dan_Matthews)\
**Post date:** [April 21, 2016, 8:50am UTC](https://discuss.elastic.co/t/excluding-properties-of-a-type-in-nest/48006/1 "2016-04-21T08:50:36Z")

</div>

I'm trying to exclude all properties of a specific type from being indexed. I don't know where they might occur or what their names will be, but I don't want them to be indexed. I don't have control of my C# objects so I can't attribute them up either.

Specifically, I need to exclude all generic lists (e.g. List, List). I am using NEST 2.

Does anyone have any ideas? I've tried playing with mappings, visits and inference and couldn't figure out how to do what I need with any of them. I'm sure it can't be as hard as I think!

Any advice appreciated.

---

<div class="post-metadata">

**Author:** ![Dan\_Matthews](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@Dan\_Matthews](https://discuss.elastic.co/u/Dan_Matthews)\
**Post date:** [April 21, 2016, 9:53am UTC](https://discuss.elastic.co/t/excluding-properties-of-a-type-in-nest/48006/2 "2016-04-21T09:53:43Z")

</div>

Update: I've created a custom serializer to filter out these properties from the JSON, but that seems ugly. Is there not a cleaner way to do this mappings?

---

<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:57pm UTC](https://discuss.elastic.co/t/excluding-properties-of-a-type-in-nest/48006/3 "2017-07-05T22:57:23Z")

</div>


