REST APIからAzure検索を呼び出すと、結果はJSONのような構造で返されます。Azure Searchの結果をデシリアライズすることはできますか?
{"@odata.context":"https://xxxx.search.windows.net/indexes('index-blob')/$metadata#docs(metadata_storage_size,metadata_storage_last_modified,metadata_storage_name,metadata_storage_path,metadata_content_type,metadata_title)","value":[{"@search.score":0.012103397,"metadata_storage_size":1479948,"metadata_storage_last_modified":"2017-04-17T18:31:18Z","metadata_storage_name":"90e975d1-3986-4167-87d2-4d1cdbc7be09.pdf","metadata_storage_path":"xxxx","metadata_content_type":"application/pdf","metadata_title":null},{"@search.score":0.004614377,"metadata_storage_size":116973,"metadata_storage_last_modified":"2017-04-13T18:24:01Z","metadata_storage_name":"xxx.pdf","metadata_storage_path":"xxxx","metadata_content_type":"application/pdf","metadata_title":"xxx"}]}
問題は、私は実際にそれを逆シリアル化する方法を見つけることができません。 "@ search.score"(またはクエリがより複雑な場合は同様のパラメータ)を逆シリアル化する構造を理解することはできません。私は様々なJSON - > C#のコンバータを使用してみました(Edit - > Paste Special in VSを含む)、何も実際には動作しません。私はこれらの結果を手動で解析しなければならないのは奇妙に思えます...私はそれをAzure SearchまたはJSONについて理解していないものに帰しています。
この問題を解決するために 'JsonProperty'属性を使用できますか? http://www.newtonsoft.com/json/help/html/T_Newtonsoft_Json_JsonPropertyAttribute.htm 例: '[JsonProperty(" @ search.score ")] public float SearchScore {get;セット; } ' - あなたの問題を理解していないのですか? – nbokmans
ありがとう、それは完全に受け入れられる!私は何らかの構造やAzure Search paramがあると思っていました。 JsonPropertyは正常に動作します。 – WirelessG