这是我的Solr嵌套文档的当前方案:
<?php
$meeting = $xml->MEET;
print_r($meeting);
?>
查询:
Type: Product
-- Type: Category
-- Type: ProductAttribute
-- -- Type: ProductAttributeValue
-- -- Type: ProductAttributeValue
示例数据格式:
http://localhost:8983/solr/MYCORE/select?q=Type:Product&rows=100&fl=*,[child parentFilter="Type:Product"]
仅在第二级查询将检索我的结果。
但是我想在3级查询并检索1级数据。
例如
[
{
"id": "p1",
"Path": 1,
"PathNew":"1.Product",
"Type": "Product",
"Title": "Build your own computer",
"ShortDescription": "Build it",
"Price": 1200,
"SKU": "COMP_CUST",
"_childDocuments_": [
{
"id": "c2_p1",
"Path": 2,
"PathNew":"2.Product.Category",
"Type": "category",
"CatName": "Desktops",
"MetaKeywords": "Desktops"
},
{
"id": "pa4_p1",
"Path": 2,
"PathNew":"2.Product.ProductAttribute",
"Type": "productAttribute",
"PAName": "HDD",
"_childDocuments_": [
{
"id": "pav6_pa4_p1",
"Path": 3,
"PathNew":"3.Product.ProductAttribute.ProductAttributeValue",
"Type": "ProductAttributeValue",
"PAVName": "320 GB"
},
{
"id": "pav7_pa4_p1",
"Path": 3,
"PathNew":"3.Product.ProductAttribute.ProductAttributeValue",
"Type": "ProductAttributeValue",
"PAVName": "400 GB"
}
]
},
{
"id": "pa5_p1",
"Path": 2,
"PathNew":"2.Product.ProductAttribute",
"Type": "productAttribute",
"PAName": "OS",
"_childDocuments_": [
{
"id": "pav8_pa5_p1",
"Path": 3,
"PathNew":"3.Product.ProductAttribute.ProductAttributeValue",
"Type": "ProductAttributeValue",
"PAVName": "Vista Home"
},
{
"id": "pav9_pa5_p1",
"Path": 3,
"PathNew":"3.Product.ProductAttribute.ProductAttributeValue",
"Type": "ProductAttributeValue",
"PAVName": "Vista Premium"
}
]
},
{
"id": "pa6_p1",
"Path": 2,
"PathNew":"2.Product.ProductAttribute",
"Type": "productAttribute",
"PAName": "Processor",
"_childDocuments_": [
{
"id": "pav1_pa6_p1",
"Path": 3,
"PathNew":"3.Product.ProductAttribute.ProductAttributeValue",
"Type": "ProductAttributeValue",
"PAVName": "2.2 GHz Intel Pentium Dual-Core E2200"
},
{
"id": "pav2_pa6_p1",
"Path": 3,
"PathNew":"3.Product.ProductAttribute.ProductAttributeValue",
"Type": "ProductAttributeValue",
"PAVName": "2.5 GHz Intel Pentium Dual-Core E2200"
}
]
},
{
"id": "pa7_p1",
"Path": 2,
"PathNew":"2.Product.ProductAttribute",
"Type": "productAttribute",
"PAName": "RAM",
"_childDocuments_": [
{
"id": "pav3_pa7_p1",
"Path": 3,
"PathNew":"3.Product.ProductAttribute.ProductAttributeValue",
"Type": "ProductAttributeValue",
"PAVName": "2GB"
},
{
"id": "pav4_pa7_p1",
"Path": 3,
"PathNew":"3.Product.ProductAttribute.ProductAttributeValue",
"Type": "ProductAttributeValue",
"PAVName": "4GB"
},
{
"id": "pav5_pa7_p1",
"Path": 3,
"PathNew":"3.Product.ProductAttribute.ProductAttributeValue",
"Type": "ProductAttributeValue",
"PAVName": "8GB"
}
]
},
{
"id": "pa9_p1",
"Path": 2,
"PathNew":"2.Product.ProductAttribute",
"Type": "productAttribute",
"PAName": "Software",
"_childDocuments_": [
{
"id": "pav10_pa9_p1",
"Path": 3,
"PathNew":"3.Product.ProductAttribute.ProductAttributeValue",
"Type": "ProductAttributeValue",
"PAVName": "Microsoft Office"
},
{
"id": "pav11_pa9_p1",
"Path": 3,
"PathNew":"3.Product.ProductAttribute.ProductAttributeValue",
"Type": "ProductAttributeValue",
"PAVName": "Acrobat Reader"
},
{
"id": "pav12_pa9_p1",
"Path": 3,
"PathNew":"3.Product.ProductAttribute.ProductAttributeValue",
"Type": "ProductAttributeValue",
"PAVName": "Total Commander"
}
]
}
]
},
{
"id": "p4",
"Path": 1,
"Type": "Product",
"Title": "Apple MacBook Pro 13-inch",
"ShortDescription": "Apple MacBook Pro 13-inch",
"Price": 1200,
"SKU": "AP_MBP_13",
"_childDocuments_": [
{
"id": "c3_p2",
"Path": 2,
"PathNew":"2.Product.Category",
"Type": "category",
"CatName": "Notebooks",
"MetaKeywords": "Notebooks"
},
{
"id": "pa4_p1",
"Path": 2,
"PathNew":"2.Product.ProductAttribute",
"Type": "productAttribute",
"PAName": "HDD",
"_childDocuments_": [
{
"id": "pav6_pa4_p1",
"Path": 3,
"PathNew":"3.Product.ProductAttribute.ProductAttributeValue",
"Type": "ProductAttributeValue",
"PAVName": "320 GB"
},
{
"id": "pav7_pa4_p1",
"Path": 3,
"PathNew":"3.Product.ProductAttribute.ProductAttributeValue",
"Type": "ProductAttributeValue",
"PAVName": "450 GB"
}
]
},
{
"id": "pa5_p1",
"Path": 2,
"PathNew":"2.Product.ProductAttribute",
"Type": "productAttribute",
"PAName": "OS",
"_childDocuments_": [
{
"id": "pav8_pa5_p1",
"Path": 3,
"PathNew":"3.Product.ProductAttribute.ProductAttributeValue",
"Type": "ProductAttributeValue",
"PAVName": "Vista Home"
},
{
"id": "pav9_pa5_p1",
"Path": 3,
"PathNew":"3.Product.ProductAttribute.ProductAttributeValue",
"Type": "ProductAttributeValue",
"PAVName": "Vista Premium"
}
]
}
]
}
]
它将退回所有台式机产品以及笔记本类别
但是,如果我想从8GB的ProductAttributeValue中检索数据,并且仅检索那些以“ RAM”作为ProductAttribute且以“ 8GB”作为其ProductAttributeValue的产品
在第三级查询时从第一级检索数据的查询是什么?