ElasticSearch - 无法使用Nest Client创建映射

时间:2014-03-20 06:46:26

标签: c# indexing elasticsearch mapping

我使用NEST client进行弹性搜索,为我的一个索引创建一个映射。我有这个方法,它应该在索引" business"上创建一个映射。但无论我做什么改变它,都没有创建映射!

public void CreateIndexWithMappings()
    {
        var mapping= client.CreateIndex("business", index => index
        .AddMapping<BusinessSearchDto>(m => m
        .Properties(props => props
        .Completion (c => c
                .Name(x => x.Name.Suffix("completion"))
                .IndexAnalyzer("analyzer_startswith")
                .SearchAnalyzer("analyzer_startswith")
                .MaxInputLength(30)
                .Payloads(true)
                .PreservePositionIncrements()
                .PreserveSeparators()
        )
        )));
    }

创建上述映射后,我正在将业务索引到新创建的&#34;业务&#34;索引。

var indexMany = client.IndexMany<BusinessSearchDto>(businessDtos, "business");

当我curl -XGET http://localhost/business/businesssearchdto/_mapping检查我的映射时,我发现没有创建映射。

我看过NEST客户端的例子,关于SO的许多其他问题以及我的想法。任何帮助赞赏。

0 个答案:

没有答案
相关问题