Skip to content
Snippets Groups Projects
Commit faeb3f9a authored by Demian Katz's avatar Demian Katz
Browse files

More consistent facet sorting behavior.

- Don't worry about default Solr behavior; now that we have sorted_by_index setting, we should always use count when index is not set.
- Resolves VUFIND-1128.
parent 47635f47
No related merge requests found
......@@ -188,15 +188,7 @@ class Params extends \VuFind\Search\Base\Params
if ($this->facetPrefix != null) {
$facetSet['prefix'] = $this->facetPrefix;
}
if ($this->facetSort != null) {
$facetSet['sort'] = $this->facetSort;
} else {
// No explicit setting? Set one based on the documented Solr behavior
// (index order for limit = -1, count order for limit > 0)
// Later Solr versions may have different defaults than earlier ones,
// so making this explicit ensures consistent behavior.
$facetSet['sort'] = ($this->facetLimit > 0) ? 'count' : 'index';
}
$facetSet['sort'] = $this->facetSort ?: 'count';
if ($this->indexSortedFacets != null) {
foreach ($this->indexSortedFacets as $field) {
$facetSet["f.{$field}.facet.sort"] = 'index';
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment