# ElasticProperty?

**URL:** <https://discuss.elastic.co/t/elasticproperty/419>\
**Category:** Elasticsearch\
**Created:** [May 8, 2015, 6:58pm UTC](https://discuss.elastic.co/t/elasticproperty/419 "2015-05-08T18:58:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wallajr](https://avatars.discourse-cdn.com/v4/letter/w/edb3f5/32.png) [@wallajr](https://discuss.elastic.co/u/wallajr)\
**Post date:** [May 8, 2015, 6:58pm UTC](https://discuss.elastic.co/t/elasticproperty/419/1 "2015-05-08T18:58:10Z")

</div>

Hi,

Can anyone tell me what this means?

[ElasticProperty(Index = FieldIndexOption.Analyzed)]  
[ElasticProperty(Index = FieldIndexOption.NotAnalyzed)]

I've been looking through documentation and I just don't understand what it means.

I asked that bc I've been trying to add a filter to a search and on every property that has one the above annotations, the result is always empty even though it should not be(to my understanding).

I am attempting to perform a query with filters. I can get it to filter on some properties but not the one I need. Here is my model:

```
public class IndexItem
{
     public DateTime CreatedDate { get; set; }

     [ElasticProperty(Index = FieldIndexOption.Analyzed)]
     public String Name { get; set; }

     [ElasticProperty(Index = FieldIndexOption.NotAnalyzed)]
     public String Role { get; set; }

     public bool ExcludeFromSearch { get; set; }
}

```

If I filter on CreatedDate or ExcludeFromSearch it works like I would think, But I cannot get it to work for Role.

filter.Add(Filter.Term(x =\> x.CreatedDate, searchDate)); // Works  
filter.Add(Filter.Term(x =\> x.Role, role)); // Never Returns a result

```
    var searchResults = client.Search<IndexItem>(s => s
            .Types(typeof(IndexItem))
            .From(start)
            .Size(count)
            .Query(esQuery)
            .Filter(x => x.And(filter.ToArray()))
     ); // Returns empty if I filter by Role, but works if i filter by CreatedDate

```

The only difference I can see is that Role has the annotation [ElasticProperty(Index = FieldIndexOption.NotAnalyzed)]. Does this make it not allowed to be filtered by?

Thanks for all the help and tips

---

<div class="post-metadata">

**Author:** ![johtani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johtani/32/44956_2.png) [@johtani](https://discuss.elastic.co/u/johtani)\
**Post date:** [May 9, 2015, 3:58pm UTC](https://discuss.elastic.co/t/elasticproperty/419/2 "2015-05-09T15:58:12Z")

</div>

Hi @wallajr,

I think you use NEST, right?  
I am not familiar with NEST, however I think FieldIndexOption.Analyzed/NotAnalyzed means [Mapping attribute](http://www.elastic.co/guide/en/elasticsearch/guide/current/mapping-intro.html#_index_2).

[This article](http://www.elastic.co/guide/en/elasticsearch/guide/current/mapping-analysis.html), what is the difference analyzed and not\_analyzed, should help you, too.

---

<div class="post-metadata">

**Author:** ![wallajr](https://avatars.discourse-cdn.com/v4/letter/w/edb3f5/32.png) [@wallajr](https://discuss.elastic.co/u/wallajr)\
**Post date:** [May 11, 2015, 3:33pm UTC](https://discuss.elastic.co/t/elasticproperty/419/3 "2015-05-11T15:33:51Z")

</div>

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 6, 2017, 12:14am UTC](https://discuss.elastic.co/t/elasticproperty/419/4 "2017-07-06T00:14:37Z")

</div>


