0
我的代碼吧..用巢
,elasticsearch 2.3.0版本 我想映射(+定製分析儀)&創建索引...指數分析儀不Elasticsearch.net築巢工作
但映射不是不成功的低級別通話錯誤!
請檢查我的代碼和審查我
var node = new Uri("http://localhost:9200");
var settings = new ConnectionSettings(node);
var client = new ElasticClient(settings);
var request = new IndexExistsRequest("aa");
var result = client.IndexExists(request);
if (result.Exists == true)
{
client.DeleteIndex("aa", null);
}
var ilhee_Custom = new CustomAnalyzer
{
Filter = new List<string> { "lowercase", "stop", "standard", "snowball" },
Tokenizer = "standard"
};
List<Person> categList = new List<Person>();
var Person = new Person
{
id = 1,
Firstname = "an apples bananas boxes, the sun.",
Lastname = "a beautiful womens with a good guys in there"
};
categList.Add(Person);
var response = client.CreateIndex("aa");
var mappingResponse = client.Map<Person>(d => d
.Properties(props => props
.String(s => s
.Name(p => p.Firstname)
.Index(FieldIndexOption.Analyzed)
.Analyzer("ilhee_Custom")
)
.String(s1 => s1
.Name(p1 => p1.Lastname)
.NotAnalyzed()
)
)
.Index("aa")
.Type("person")
);
var b = client.IndexMany<Person>(categList, "aa", "person");
我真的很感激它返回我們的索引文檔!謝謝!!! –
我還有一個問題..! 我可以在哪裏添加stopword_path? –
使用指定的stopword_path定義您自己的「stop」標記過濾器,並在您的自定義分析器中使用它 - https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-stop-tokenfilter.html –