I currently have an ajax request set up in my javascript to call the search API but this only gives me departments matching whatever I input for query
:
$.ajax(
{
url: _spPageContextInfo.webAbsoluteUrl + "/_api/search/query?querytext='Department:"
+ query
+ "*'&selectproperties='Department'&sourceid='<removed>'&sortlist='Department:ascending'",
method: "GET",
headers: {
"accept": "application/xml",
},
success: onSuccess,
error: onError
}
);
How can I query search so that I get ALL departments back? I can do the filtering for distinct departments once I get the data back, but I don't want to search for a particular department. I want all of them.