com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links' is unknown.

Retrieving Aggregated Values of Given Records via JS API

Overview

Function

searchWithAggregates (queryInfo, success, error)

Description

Returns the aggregated values of the given records.

Output

A JSON String object containing the aggregated values of the given records, in the ‘message’ element within the argument of the success callback.

Example

var queryInfo = {
	tableName:"TEST",
 	searchParams : {		
		groupByField:"single_valued_facet_field",
		query : <lucene-query>
		fields:[
		{
			fieldName:"n",
			aggregate:"AVG",
			alias:result_avg"
		},
		{
			fieldName:"n",
			aggregate:"MAX",
			alias:"result_max"
		}
		]
	}
}
client.searchWithAggregates(queryInfo, function(data) {
      console.log (data["message"]);
}, function(error) {
      console.log("error occured: " + error);  
});

Sample output

[{
    "id":"14399961246350.13125980939205978",
    "tableName":"TEST","timestamp":1439996124610,
    "values":{
        "result_avg":"20",
        "result_max":"22",
		"single_valued_facet_field":[engineering] //This should be a facet with a single value.
    }
},
{
    "id":"14399961246350.13125980939205999",
    "tableName":"TEST","timestamp":1439996124610,
    "values":{
        "result_avg":"34",
        "result_max":"46"
		"single_valued_facet_field":[marketing] //This should be a facet with a single value.
    }
}
 
]
com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links2' is unknown.