GetAlternativeQueries input: string Query, int NumberOfResults output: AlternativeTerm[] AlternativeQueriesResult
Takes as an input a Query, and a NumberOfResults to restrict the number of suggestions.
Helps answer two questions:
What are the search entities identified within that query?
What are the alternative names to refer to these entities?
For example, a query “all blacks new zealand” is descected as follows:
See also Try also suggestions.
Sample code in C#:
PingarAPIRequest request = new PingarAPIRequest();
request.AppID = "your app id";
request.AppKey = "your app key";
request.SearchSupport = new SearchSupportRequest();
request.SearchSupport.Query = "sample query";
request.SearchSupport.NumberOfResults = 5;
request.Language = Language.EN;
PingarAPIServiceSoapClient pingarAPI = new PingarAPIServiceSoapClient();
PingarAPIResponse response = pingarAPI.GetAlternativeQueries(request);
if (response.Error == null)
{
Console.Write("Alternative terms for query: ");
foreach (AlternativeTerm term in
response.SearchSupport.AlternativeQueriesResult)
{
Console.WriteLine(term.Title + " (" + term.Score + ")");
}
}