Sorting removed from Drupal query

Created on 8 February 2023, almost 2 years ago
Updated 13 February 2023, almost 2 years ago

Problem/Motivation

When working with the Solr instance locally, sorting works as designed. When activating this module and using the SearchStax Studio index, we noticed that the sorting does not seem to be functioning correctly (or at all). When using a sort dropdown and selecting an option to sort, nothing changes.

For test purposes we disabled the option for "Configure searches exclusively via SearchStudio" and the sorting was working again but this gets rid of all relevance modeling within SearchStax.

Steps to reproduce

Add options to sort in your search view. When viewing the page, change the sort option and the results do not change.

Proposed resolution

After some searching we found that the SearchStax module empties out the sorting values before being sent to SearchStax (REF: https://git.drupalcode.org/project/searchstax/-/blob/1.x/searchstax.modu...). Code sample:

/**
 * Remove all sorts.
 *
 * @return self Provides fluent interface
 */
public function clearSorts(): self
{
    $this->sorts = [];

    return $this;
}

Would there be a way to possibly still send the sorting options from Drupal but still allow SearchStax to manage those sorting options and add relevancy to them?

💬 Support request
Status

Fixed

Version

1.3

Component

Code

Created by

🇺🇸United States rpearl

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024