適応型検索問合せ: スマート提案
Smart Suggest(スマート提案)は、検索結果に対する提案をユーザーに提供します。 インデックスは、フィールドのリストとそのフィールドにインデックス付けされた有効な値を検索するために使用されます。
レスポンス・ペイロードは、保存済問合せのシリアル化された出力に似たアイテムのリストで、ユーザーは一時プリファレンスで適応型検索で検索したり、同じものを格納するために使用できます。 範囲ベースのフィールドに対するフィールド値のペアまたはフィールド値のペアごとにq式があります。
フィルタのサンプル・リクエストおよびレスポンス
リクエストは次のとおりです。
POST /crmRestApi/searchResources/11.13.18.05/custom-actions/queries?
HTTP/1.1 200 OK
Content-Type: application/json
Preference: recommend
{
"suggestions": {
"type": "filter",
"keyword": ""
},
"entity": "Lead",
"q": null,
"keywords": "",
"fields": [
"CreationDate"
],
"limit": 25,
"offset": 0
}
レスポンス・ペイロードは次のとおりです:
{
"items": [
{
"_entity": "Lead",
"count": 13,
"q": {
"op": "$wi",
"attribute": "CreationDate",
"value1": "now/d",
"value2": "now/d+1d"
},
"field": "CreationDate",
"localizedValue": "Today"
},
{
"_entity": "Lead",
"count": 11,
"q": {
"op": "$wi",
"attribute": "CreationDate",
"value1": "now/w-1w",
"value2": "now/w"
},
"field": "CreationDate",
"localizedValue": "Last Week"
},
{
"_entity": "Lead",
"count": 187,
"q": {
"op": "$wi",
"attribute": "CreationDate",
"value1": "now/M-1M",
"value2": "now/M"
},
"field": "CreationDate",
"localizedValue": "Last Month"
},
{
"_entity": "Lead",
"count": 209,
"q": {
"op": "$wi",
"attribute": "CreationDate",
"value1": "now/M-3M",
"value2": "now/M"
},
"field": "CreationDate",
"localizedValue": "Last Quarter"
},
{
"_entity": "Lead",
"count": 210,
"q": {
"op": "$wi",
"attribute": "CreationDate",
"value1": "now/y-1y",
"value2": "now/y"
},
"field": "CreationDate",
"localizedValue": "Last Year"
}
],
"count": 5,
"hasMore": false,
"limit": 25,
"offset": 0,
"totalResults": 5
}
フィールドのサンプル・リクエストおよびレスポンス
リクエストは次のとおりです
POST /crmRestApi/searchResources/11.13.18.05/custom-actions/queries?
HTTP/1.1 200 OK
Content-Type: application/json
Preference: recommend
{ "entity":"Account",
"suggestions":{
"type":"field",
"keyword":"Primary"
},
"limit":3
}
レスポンス・ペイロードは次のとおりです:
{
"items": [
{
"_entity": "Account",
"localizedValue": "Primary Address:: ",
"field": "PrimaryAddress"
},
{
"_entity": "Account",
"localizedValue": "Primary Contact:: ",
"field": "PrimaryContact"
}
],
"count": 2,
"hasMore": true,
"limit": 2,
"offset": 0,
"totalResults": 32
}