I have retrieve SharePoint search results using javascript on SharePoint Online with following code:
var keywordQuery = new Microsoft.SharePoint.Client.Search.Query.KeywordQuery(context);
keywordQuery.set_queryText("queryText here");
keywordQuery.set_trimDuplicates(false);
keywordQuery.set_rowLimit(500);
var searchExecutor = new Microsoft.SharePoint.Client.Search.Query.SearchExecutor(context);
results = searchExecutor.executeQuery(keywordQuery);
context.executeQueryAsync(onQuerySuccess, onQueryFail);
I got results successfully in onQuerySuccess
:
function onQuerySuccess() {
$.each(results.m_value.ResultTables[0].ResultRows, function () {
console.log(this.Title + ' - ' + this.Author);
// I want managed metadata column value here (same as Title & Author) if managed metadata column is exist in the search result
});
}
I got Title, Author, Path properties.
Now I want to get value of column type Managed Metadata if that column is exist in the search result. How can I get it ? No any managed metadata column is fixed. It can be different for all search results or column should not exist in the search result.