i put the custom analyzer through POSTMAN..
{
"settings": {
"index": {
"number_of_shards": "3",
"number_of_replicas": "1"
},
"analysis" : {
"analyzer" : {
"ilhee_Custom" : {
"tokenizer" : "whitespace",
"filter" : ["lowercase", "my_stoplist", "snowball", "word_delimiter"]
}
},
"filter" : {
"my_stoplist" : {
"type" : "stop",
"stopwords_path" : "stopword_list.txt",
"remove_trailing" : true
}
}
}
},
"mappings": {
"mc": {
"properties": {
"id": {
"type": "long"
},
"code": {
"type": "string"
},
"mainclass": {
"type": "string",
"analyzer": "ilhee_Custom"
}
}
}
}
}
i would like to change the code to plain elasticsearch (C# code).. this is my current code status... I really want add custom filte " my_stoplist filter... custom stop word list" but.. i don't know how can i change any more ..
private static string BuildCompanyMapping()
{
return new PlainElastic.Net.Mappings.MapBuilder<mc>()
.RootObject(typeName: "mc",
map: r => r
.All(a => a.Enabled(false))
.Dynamic(false)
.Properties(pr => pr
.String(mc => mc.mainclass, f => f.Analyzer(DefaultAnalyzers.snowball))
.String(mc => mc.code, f => f.Analyzer(DefaultAnalyzers.whitespace))
.Number(mc => mc.id, null)
)
)
.BuildBeautified();
}
private static string BuildIndexSettings()
{
return new IndexSettingsBuilder()
.Analysis(als => als
.Analyzer(a => a
.Custom("ilhee_Custom", custom => custom
.Tokenizer(DefaultTokenizers.whitespace)
.Filter(DefaultTokenFilters.lowercase,DefaultTokenFilters.snowball,DefaultTokenFilters.stop)
)
.Custom("fulltext", custom => custom
.CharFilter(DefaultCharFilters.html_strip)
.Tokenizer(DefaultTokenizers.standard)
.Filter(DefaultTokenFilters.word_delimiter,
DefaultTokenFilters.lowercase,
DefaultTokenFilters.stop,
DefaultTokenFilters.standard)
)
)
)
.BuildBeautified();
}