var ids = new Dictionary<string, List<string>>();
ids["Topic"] = new List<string> {"KL7KJ2QBWD77yvpxyjvd", "374wJ2QBWD77yvpxDjpX", "B7499GMBWD77yvpxFzgW"};
ids["Prod"] = new List<string>();
ids["Account"] = new List<string>();
I made this fluent NEST query:
var results = client.MultiGet(m =>
m.Index("topics").GetMany<Topic>(ids["Topic"])
.Index("prods").GetMany<Prod>(ids["Prod"])
.Index("accounts").GetMany<Account>(ids["Account"])
it's generating the request below. We see the request use only the last index set which is "accounts" (and this is not what I need) :
http://localhost:9200/accounts/_mget?pretty=true
{
"docs": [
{
"_type": "Topic",
"_id": "KL7KJ2QBWD77yvpxyjvd"
},
{
"_type": "Topic",
"_id": "374wJ2QBWD77yvpxDjpX"
},
{
"_type": "Topic",
"_id": "B7499GMBWD77yvpxFzgW"
}
]
}
# Response:
{
"docs" : [
{
"_index" : "accounts",
"_type" : "Topic",
"_id" : "KL7KJ2QBWD77yvpxyjvd",
"found" : false
},
{
"_index" : "accounts",
"_type" : "Topic",
"_id" : "374wJ2QBWD77yvpxDjpX",
"found" : false
},
{
"_index" : "accounts",
"_type" : "Topic",
"_id" : "B7499GMBWD77yvpxFzgW",
"found" : false
}
]
}
In fact I would like to create in fluent NEST the following (valid) Elasticsearch query request (with no specific index) :
http://localhost:9200/_mget?pretty=true
{
"docs": [
{
"_index": "topics",
"_type": "Topic",
"_id": "KL7KJ2QBWD77yvpxyjvd"
},
{
"_index": "topics",
"_type": "Topic",
"_id": "374wJ2QBWD77yvpxDjpX"
},
{
"_index": "topics",
"_type": "Topic",
"_id": "B7499GMBWD77yvpxFzgW"
}
]
}
Is there a way, in fluent NEST, to specify each index/type for each list of ids ?
And of course if I'm adding specific ids to ids["Prod"] and ids["Account"] this will be generated properly for those... for instance:
http://localhost:9200/_mget?pretty=true
{
"docs": [
{
"_index": "topics",
"_type": "Topic",
"_id": "KL7KJ2QBWD77yvpxyjvd"
},
{
"_index": "prods",
"_type": "Prod",
"_id": "xxxxx"
},
{
"_index": "accounts",
"_type": "Account",
"_id": "yyyyy"
}
]
}