Analytics Services
The purpose of the Analytics Service is to expose the necessary method for retrieving augmented Analytics data from the internal store.
The functionality this service exposes are:
- http(s)://<smart-hub-webapp>/_bai/Analytics/queryRecommendations
Query Recommendations
-
Method:
-
POST
-
-
Headers:
-
Content-Type: application/json
-
- Response type:
- JSON object
-
Request object:
Property Format Description UserProfileProperties An array of Key/Value pairs like
[{"Key":"key","Value":"value"},{"Key":"key ","Value":"value"}]
These properties represent the user profile properties of the current user.
Depending on your configuration the Analytics service can rely on them to drive certain filtering of the analytics data you retrieve - such as:
-
Including just the Analytics of users from the same Country, Department and Age group, etc.
In general you would be fetching these value from the UserProfile Service from SmartHub but it's also possible to manually compute them from other external services or data sources
QueryText String value The query text for which the recommendations are fetched QuerySuggestionsOptions String value (serialized array of JSON objects)
The settings that control the recommendation service.
These settings are in the form of a serialized JSON object that includes an array of object with the following properties:
- Id - the ID of the algorithms
- NoOfSuggestions - the number of suggestions to fetch
For example: To fetch recommendations for 2 algorithms:
-
5 suggestions for algorithm 0
-
2 suggestions for algorithm 1
-
the value would be:
"[{\"NoOfSuggestions\":\"5\",\"Id\":\"0\"},{\"NoOfSuggestions\":\"2\",\"Id\":\"1\"}]"
-
-
Response object:
The response will be an array of objects, one entry for every QuerySuggestionOptions specified in the requestProperty Format Description OptionId String value The ID of the algorithm that generated the suggestion QueryRecommendations Array of objects The recommendations generated by the service - QueryText
String value The recommended query text to suggest - HitCount
Numeric value The number of results that match the recommended query text