Finally found, find the solution. I have added a property owsmetadatafacetinfo
to keyword query:
var properties = keywordQuery.get_selectProperties();
properties.add('owsmetadatafacetinfo');
Then in the query results
, I got the null
if managed metadata column does not exist for search result.
If metadata column exist then, I got it with column & it's value for current search result with property owsmetadatafacetinfo
:
function onQuerySuccess() {
$.each(results.m_value.ResultTables[0].ResultRows, function () {
console.log(this.Title + ' - ' + this.Author);
/* Following will return value like:
> Carx0020Filter|Car Filter|kpEc4Tt0Bk6aYzIoWUkAng==|YS6tyhuAgUWauGGOBUO7Hg==|#d317325c-2705-4006-8158-eea6f2629618|Lamborghini;#"
Here, 'Car Filter' is managed metadata column & 'Lamborghini' is value for current search result */
console.log(this.owsmetadatafacetinfo);
});
}
It's return like:
Carx0020Filter|Car Filter|kpEc4Tt0Bk6aYzIoWUkAng==|YS6tyhuAgUWauGGOBUO7Hg==|#d317325c-2705-4006-8158-eea6f2629618|Lamborghini;#"
Where, Car Filter
is managed metadata column (with internal name Carx0020Filter
) & Lamborghini
is value for current search result.