Regular expression processor shouldn't run on queries

Created on 9 August 2023, about 1 year ago
Updated 10 August 2023, about 1 year ago

Setup

  • Solr version: 8.1
  • Drupal Core version: 9.5
  • Search API version: 8.x-1.29
  • Search API Solr version: 4.2.12
  • Configured Solr Connector: search_api_pantheon

Issue

The solr_regex_replace processor runs on all stages: preprocess_index, preprocess_query, and postprocess_query. However, it seems the query stages have the side effect of corrupting searches when the regex is too broad. This happens even if the regex is restricted to only certain fields.

In my opinion, regex doesn't need to run on queries at all. Or, alternatively, the regex processor could be split into two, one for index time and one for query time.

Steps to reproduce:

  1. Enable Regular expression processor
  2. Set regex replace pattern to something general like 1-9 -> A
  3. Restrict to a field
  4. Create a Search results view, Fulltext search on all fields (default)
  5. Search an exact string containing 1-9 from a different field

Exact match should return results
Search returns no results

πŸ› Bug report
Status

Active

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States earthday47

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

Comments & Activities

Production build 0.71.5 2024