Setting analyzer from plugin in ElasticSearch with NEST -
my first post ! i'm trying set stempel analyzer (es analyzer polish language) string field. can through put request:
{ "doc": { "_source": { "enabled": false }, "properties": { "file": { "type": "attachment", **"analyzer": "polish"**, "fields": { "content": { "type": "string", "term_vector": "with_positions_offsets" } } } } } }
and works fine. trying same thing through nest.
[elasticproperty(name = "_content", termvector = termvectoroption.withpositionsoffsets, analyzer = "polish")] public string content { get; set; }
is not working neither do:
client.createindex(index, b => b.addmapping<docines>(m => m .mapfromattributes() .properties(props => props .string(s => s .name(p => p.file.content) .analyzer("polish") ))));
when i'm using
var result = client.analyze(a => a.index("doc").analyzer("polish").text("...text..."));
it works fine, .net detecting analyzer. i'm using es 2.1.1. & nest 1.7.1
edit: inspected seems nest not doing mapping of attributes of attachment class created in .net. map attributes of document class
[elastictype(name = "docines")] public class docines { public int institutionid { get; set;} public int documentid { get; set; } [elasticproperty(store = true, analyzer = "polish")] public string title { get; set; } [elasticproperty(type = fieldtype.attachment)] public attachment file { get; set; } }
but not attachment class:
public class attachment { [elasticproperty(name = "content2", store = true)] public string content { get; set; } [elasticproperty(name = "content_type2")] public string contenttype { get; set; } [elasticproperty(name = "name2", analyzer = "english")] public string name { get; set; } }
you should check compatibility matrix on github.
nest 1.7.1 not compatible es 2.1.1
Comments
Post a Comment