Unable to search for strings with dash

Created on 8 February 2023, almost 2 years ago
Updated 4 March 2023, over 1 year ago

Problem/Motivation

I'm unsure if this is ultimately a problem with Search API or Search API Pages.

We're having difficulty finding results that contain strings that contain dashes, e.g. "mango-banana". Using Solr Devel it's possible to see that entering "mango-banana" as the search phrase results in the query string "mango banana" being passed to Solr. I have not yet examined Solr directly to see how such strings are being indexed, but the removal of the dash in the query string is going to make that a moot point.

Steps to reproduce

Create a standard index of content with a Search API Pages page.
Index content that contains dashes, e.g. "mango-banana".
Use the search page to search for "mango-banana".

Expected results:
* The item with the string "mango-banana" is listed in the results.

Actual results:
* No results are shown.

Proposed resolution

Work out how to resolve this problem.

Remaining tasks

Work out the source of the problem.

User interface changes

TBD

API changes

TBD

Data model changes

TBD

🐛 Bug report
Status

Postponed: needs info

Version

1.0

Component

Code

Created by

🇺🇸United States DamienMcKenna NH, USA

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

Comments & Activities

  • Issue created by @DamienMcKenna
  • Assigned to DamienMcKenna
  • 🇺🇸United States DamienMcKenna NH, USA

    Will dig into this more.

  • Status changed to Postponed: needs info over 1 year ago
  • 🇦🇹Austria drunken monkey Vienna, Austria

    I just tested, and this is certainly not the general behavior. It has to be specific to your setup.
    Which processors do you have enabled on your search index? The “Tokenizer” processor, for instance, could be responsible, depending on its “Whitespace characters” setting. (It should be enabled anyways, however, when using Solr – just like most other processors.)
    Otherwise, your best bet is to use a debugger to step through the search (starting at search_api_page_view()) to see where/when the change occurs.

Production build 0.71.5 2024