I need to search components based on keywords using core-service. and I am using the SearchQueryData
class to search.
I am using below function:
public XElement GetSearchResults(string[] keywordList)
{
var filter = new SearchQueryData { ItemTypes = new[] { ItemType.Component } };
if (keywordList != null && keywordList.Any())
{
//Keyword Filtering
var lnkKeywords = Array.ConvertAll(keywordList, t => new LinkToKeywordData { IdRef = t });
filter.UsedKeywords = lnkKeywords;
filter.SearchInSubtree = true;
}
var results = ProxyClient.GetSearchResultsXml(filter);
return results;
}
But it supports just a single keyword. If I pass more than one Keyword to the function, it just picks the first one and ignore the others. I have read the documentation and it says "Current implementation allows only one Keyword".
So if it could not be achieved by using "SearchQueryData" class, What could be the other possible ways to achieve this?