Problem/Motivation

I followed your instructions to create a facet 3 over a Commerce 3 Price field, indexed in Solr as an integer:

  • Add variations:entity:price:number field to search_api index.
  • In views` facets processor (in settings of an Facet category exposed filter) tick "Custom Facets Exposed Range Slider"
  • Ticks "Range slider" and "Slider" must be unchecked.
  • In Better Exposed Filters settings of the exposed filter, in "Exposed filter widget:" choose "Custom Facets Exposed Sliders".

But I've got this error: Drupal\facets\Exception\InvalidQueryTypeException: Query type custom_range doesn't exist. in Drupal\facets\Entity\Facet->pickQueryType() (line 573 of modules/contrib/facets/src/Entity/Facet.php). Am I missing something?

Thanks for your help.

Issue fork frs-3574976

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

interdruper created an issue. See original summary.

nickolaj made their first commit to this issue’s fork.

nickolaj’s picture

Status: Active » Needs review

The `custom_range` query type is never registered because the alter hook only adds it when the `range` query type already exists in the mapping. Removed the conditional check so `custom_range` is always registered.