Some searches support faceted search and filtering. This can be used to obtain more details about the filters available and provide a better user experience
Fetching the faceted filters
URL : /SearchService.js
Method : POST
Auth required : Yes
Required parameters
Name | Example | Description |
---|---|---|
SearchName | DigiZuite_System_Framework_Search | Fixed parameter that identifies the endpoint search. |
config | facet=true | Enables the faceting search. |
config | facet.limit=101 | Limits the number of options returned for each filter . |
config | facet.field={!ex=sAssetType}sAssetType | Enabled faceted result for the filter sAssetType. A list of all filters can be obtain using the DC 5.4.0 6.2.10 - GetVisibleSearchFields endpoint. |
config | f.sAssetType.facet.sort=count | Sorts the options returns or the sAssetType filter. Available values:
|
accessKey | 2d8319f4-7a57-4ca0-a027-c44c2f259aac | AccessKey for API |
Optional parameters
N/A
cUrl data example
Success Response
Code : 200 OK
Content example
{ "success":true, "error":"", "total":"3396", "items":[ /* ...items returned by the search... */ ], "extra":[ { "responseHeader":{ "warnings":[ "Raising facet.mincount from 0 to 1, because field sAssetType is Points-based.", ], "status":"0", "QTime":"2", "params":{ "facet.field":[ "{!ex=sAssetType}sAssetType", ], "f.sAssetType.facet.sort":"count", "start":"0", "sort":"sortAssetidDesc desc", "rows":"1", "facet.limit":"101", "wt":"xml", "facet":"true" } } }, { "facet_counts":{ "facet_queries":{}, "facet_fields":{ "sAssetType":{ "4":"3013", // Number of asset of asset type 4 "1":"135", // Number of asset of asset type 1 "8":"72", "14":"43", "15":"37", "9":"21", "2":"17", "10":"13", "16":"10", "17":"10", "11":"9", "5":"6", "7":"4", "18":"2", "19":"2", "100":"2" }, }, "facet_ranges":{}, "facet_intervals":{}, "facet_heatmaps":{} } } ] }
Error Response
Code : 200 OK
Content example
{ "success": false, "total": 0, "error": "A critical exception occurred while we executed the search.\r\n", "items": null, "warnings": [{ "Severity": 150, "Code": 420, "Description": "A critical exception occurred while we executed the search." }] }