我有一个包含子文档的json文件。一个文档(父母和孩子)看起来像这样-
var path = "C:\\rust server\\RustDedicated_Data\\Managed";
var coreFiles = Directory.GetFiles(path, "vmecore.*.dll");
var coreExtension = new List<Type>();
// Load each assembly into domain
foreach (var file in coreFiles)
{
var lAssembly = Assembly.LoadFile(file);
var assembly = Assembly.Load(lAssembly.FullName);
builder.RegisterAssemblyTypes(assembly)
.Where(t => t.IsAssignableTo<IVmeExtension>())
.SingleInstance();
// Add all IVmeExtension types
coreExtension.AddRange(assembly.GetExportedTypes()
.Where(a => a.IsClass &&
!a.IsAbstract &&
a.Namespace != null &&
a.Namespace.Contains(@"VME") &&
typeof(IVmeExtension).IsAssignableFrom(a)));
}
row_id 是唯一键。父母和相对应的孩子是相同的,父母之间的差异以及一个父母与另一个父母的子女之间的差异。
我已经使用 curl 命令在Solr(v 4.8)中为文档建立了索引。此后,当我尝试查询{
"table_id":"1",
"table_name":"mydb.tablename",
"row_id":"tn1-1",
"_childDocuments_":[
{
"Name":"st_id",
"Value":"10",
"row_id":"tn1-1"
},{
"Name":"age",
"Value":"56",
"row_id":"tn1-1"
},{
"Name":"gender",
"Value":"male",
"row_id":"tn1-1"
},{
"Name":"country",
"Value":"india",
"row_id":"tn1-1"
},{
"Name":"row_id",
"Value":"tn1-1",
"row_id":"tn1-1"
}
]
}
时,我得到了关注-
row_id = "tn1-1"
如您所见,它不会返回包含该row_id的所有子文档。我什至尝试了url编码($ curl --negotiate -u: 'https://myurl/solr/my_collection/select?q=row_id:tn1-1&wt=json&indent=true'
{
"responseHeader":{
"status":0,
"QTime":1425,
"params":{
"q":"row_id:tn1-1",
"indent":"true",
"wt":"json"}},
"response":{"numFound":1,"start":0,"maxScore":5.7210464,"docs":[
{
"Name":"st_id",
"Value":"10",
"row_id":"tn1-1",
"_version_":1208395294328234524}]
}}
),但返回的结果相同。
谁能告诉我我做错了什么?是不正确的文件格式还是查询?我希望solr返回其row_id与查询中给定匹配的所有子文档。