你有沒有考慮過使用Collection(Edm.String)字段類型?看一看,如果下面的索引定義會爲你工作:
{
"name": "products",
"fields": [
{"name": "productId", "type": "Edm.String", "key": true, "searchable": false},
{"name": "productName", "type": "Edm.String"},
{"name": "orderNames", "type": "Collection(Edm.String)"}
]
}
然後,您可以索引你的文件是這樣的:
{
"value":[
{
"productId":"1",
"productName":"product1",
"orderNames":[
"order1",
"order2"
]
},
{
"productId":"2",
"productName":"product2",
"orderNames":[
"order1",
"order2"
]
}
]
}
或者您可以在反向產品 - 訂單關係,並有秩序的主要實體,它的所有屬性,包括產品名稱:
{
"name":"orders",
"fields":[
{
"name":"ordertId",
"type":"Edm.String",
"key":true,
"searchable":false
},
{
"name":"productName",
"type":"Edm.String"
},
{
"name":"orderName",
"type":"Edm.String"
}
]
}
看看下面doc- http://azure.microsoft.com/en-in/documentation/articles/search-get-started-dotnet/ – VIVEK 2015-03-31 07:44:10
我已經看過這個鏈接。沒有這樣的線索可以回答我的問題。 – 2015-03-31 07:46:00