我正在学习巢穴和弹性搜索,其中一些基本知识让我感到困惑。如果我创建一个基本索引,使用Nest集成测试:
var client = ElasticsearchConfiguration.Client;
if (client.IndexExists(ElasticsearchConfiguration.DefaultIndex).Exists)
return;
var projects = NestTestData.Data;
var people = NestTestData.People;
client.CreateIndex(ElasticsearchConfiguration.DefaultIndex, c => c
.NumberOfReplicas(0)
.NumberOfShards(1)
.AddMapping<ElasticSearchProject>(m => m.MapFromAttributes())
.AddMapping<Person>(m => m.MapFromAttributes())
);
client.CreateIndex(ElasticsearchConfiguration.DefaultIndex + "_clone", c => c
.NumberOfReplicas(0)
.NumberOfShards(1)
.AddMapping<ElasticSearchProject>(m => m.MapFromAttributes())
.AddMapping<Person>(m => m.MapFromAttributes())
);
var bulkParameters = new SimpleBulkParameters() { Refresh = true };
client.IndexMany(projects, bulkParameters);
client.IndexMany(people, bulkParameters);
client.Refresh(new[] {ElasticsearchConfiguration.DefaultIndex, ElasticsearchConfiguration.DefaultIndex + "_clone"});我不明白这个操作后ElasticClient的状态。
1)为什么ElasticClient在此操作之后仍然有效= False。那么,有效意味着什么呢?
2) CreateIndex函数返回一个IIndicesOperationResponse,它的状态属性OK设置为false,即使我知道正在创建索引。好的是什么意思?
发布于 2014-04-07 19:29:13
OK属性。https://stackoverflow.com/questions/22045442
复制相似问题