String fields = Tools.stringSearchParamOrEmpty(request, "fields");
int width = request.getQueryString("width") == null ? -1 : Integer.valueOf(request.getQueryString("width"));
String filter = search.getFilter();
String query = search.getQuery();
TimeRange timeRange = search.getTimeRange();
// TODO we desperately need to pass the streamid and then build the filter here, instead of passing the filter and then trying to reassemble the streamid.
if (filter != null && filter.startsWith("streams:")) {
return routes.StreamSearchController.index(
filter.split(":")[1],
query,
timeRange.getType().toString().toLowerCase(),
relative,
from,
to,
keyword,
interval,
page,
"",
sortField,
sortOrder,
fields,
width
);
} else {
return routes.SearchController.index(
query,
timeRange.getType().toString().toLowerCase(),
relative,
from,
to,
keyword,
interval,