Solr syntax error or empty keyword (after postprocessing)

Created on 1 March 2022, over 2 years ago
Updated 19 June 2024, 5 months ago

Respect the submission guidelines above! Drupal.org issue forks cause additional work for the project maintainer!

Setup

  • Solr version: 8.8.2
  • Drupal Core version: 9.3.6
  • Search API version: 1.23.0
  • Search API Solr version: 4.x DEV
  • Configured Solr Connector: Standard

Issue

Every keyword that less than 3 characters gives a Solr syntax error, for example at `/search?fulltext_search=sa` , provided by `/admin/config/search/pages`, backed by Solr:
Drupal\search_api_solr\SearchApiSolrException: An error occurred while trying to search with Solr: { "error":{ "metadata":[ "error-class","org.apache.solr.common.SolrException", "root-error-class","org.apache.solr.parser.ParseException"], "msg":"org.apache.solr.search.SyntaxError: Cannot parse ' (tm_X3b_en_title:(())^2 tm_X3b_es_title:(())^2 tm_X3b_und_title:(())^2 tm_X3b_en_field_bio:(())^1 tm_X3b_es_field_bio:(())^1 tm_X3b_und_field_bio:(())^1 tm_X3b_en_join_us_field_text:(())^1 tm_X3b_es_join_us_field_text:(())^1 tm_X3b_und_join_us_field_text:(())^1 tm_X3b_en_join_us_formatted_text:(())^1 tm_X3b_es_join_us_formatted_text:(())^1 tm_X3b_und_join_us_formatted_text:(())^1 tm_X3b_en_story_field_formatted_text:(())^1 tm_X3b_es_story_field_formatted_text:(())^1 tm_X3b_und_story_field_formatted_text:(())^1 tm_X3b_en_story_field_text:(())^1 tm_X3b_es_story_field_text:(())^1 tm_X3b_und_story_field_text:(())^1)': Encountered \" \")\" \") \"\" at line 1, column 21.\nWas expecting one of:\n ...\n \"+\" ...\n \"-\" ...\n ...\n \"(\" ...\n \"*\" ...\n ...\n ...\n ...\n ...\n ...\n \"[\" ...\n \"{\" ...\n ...\n \"filter(\" ...\n ...\n ...\n ", "code":400}} in Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend->search() (line 1790 of /code/web/modules/contrib/search_api_solr/src/Plugin/search_api/backend/SearchApiSolrBackend.php).

For longer keywords, the example query works. For empty keyword, it works too. It only fails when the result of the postprocessing is that the keyword becomes empty.

πŸ› Bug report
Status

Needs work

Version

4.0

Component

Code

Created by

πŸ‡­πŸ‡ΊHungary aron novak Hungary, Budapest

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024