I am having a problem using the bulk method method in NEST to index child records in Elasticsearch.
I am using ElasticSearch 2.3.5 and NEST 2.4.4
I displayed the index as such:
myindex
{
"mappings": {
"elasticparent": {},
"elasticchild": {
"_parent": {
"type": elasticparent
}
}
}
}
And I indexed the parent objects using the IndexMany method :
client.IndexMany<elasticparent>(batch, "myindex");
It all works well.
Now I would like to index children using IndexMany . Here is what I have tried so far:
client.Bulk(s => s.IndexMany(IenumerableOfChild,
(bulkDescriptor, record) =>
bulkDescriptor.Index("myindex").Type("elasticchild").Parent(record.Id)));
The child and parent have the same integer Id.
I do not get an error, but children are never indexed and documents are not added to the general indexed account.
Indexing them individually works :
foreach (var child in IenumerableOfChild
{
client.Index(child, descriptor => descriptor
.Parent(child.Id.ToString()).Index("myindex"));
}
. IndexMany . - , ?