catch (SQLException e)
{
throw new SearchProcessorException(e.getMessage(), e);
}
DiscoveryConfiguration discoveryConfiguration = SearchUtils
.getDiscoveryConfiguration(scope);
List<DiscoverySortFieldConfiguration> sortFields = discoveryConfiguration
.getSearchSortConfiguration().getSortFields();
List<String> sortOptions = new ArrayList<String>();
for (DiscoverySortFieldConfiguration sortFieldConfiguration : sortFields)
{
String sortField = SearchUtils.getSearchService().toSortFieldIndex(
sortFieldConfiguration.getMetadataField(),
sortFieldConfiguration.getType());
sortOptions.add(sortField);
}
request.setAttribute("sortOptions", sortOptions);
DiscoverQuery queryArgs = DiscoverUtility.getDiscoverQuery(context,
request, scope, true);
queryArgs.setSpellCheck(discoveryConfiguration.isSpellCheckEnabled());
List<DiscoverySearchFilterFacet> availableFacet = discoveryConfiguration
.getSidebarFacets();
request.setAttribute("facetsConfig",
availableFacet != null ? availableFacet
: new ArrayList<DiscoverySearchFilterFacet>());
int etal = UIUtil.getIntParameter(request, "etal");
if (etal == -1)
{
etal = ConfigurationManager
.getIntProperty("webui.itemlist.author-limit");
}
request.setAttribute("etal", etal);
String query = queryArgs.getQuery();
request.setAttribute("query", query);
request.setAttribute("queryArgs", queryArgs);
List<DiscoverySearchFilter> availableFilters = discoveryConfiguration
.getSearchFilters();
request.setAttribute("availableFilters", availableFilters);
List<String[]> appliedFilters = DiscoverUtility.getFilters(request);
request.setAttribute("appliedFilters", appliedFilters);