Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ElasticType and ElasticProperty attributes non found on nest.dll 2.1.1

I'm learning elasticsearch+nest, i want to map a type into a net class:

[ElasticType(Name="car")]
public class Car {} 
{
    [ElasticProperty(Name = "color", Index = FieldIndexOption.NotAnalyzed, Type = FieldType.String)]
    public string Color { get; set; }
}

but the code does not compile neither ElasticType and ElasticProperty is available.

I referenced nest.dll 2.1.1 and Elasticsearch.Net.dll 2.1.1 from nuget.

like image 516
FDB Avatar asked Apr 12 '16 13:04

FDB


1 Answers

1) For 6.6 you should use ElasticsearchType instead of ElasticType.

https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/attribute-mapping.html

2) Add "using Nest;" to file where Car class resides (NEST Nuget package must be added to same project).

like image 98
Dr. Avatar answered Oct 23 '22 15:10

Dr.