- Issue created by @yazzbe
- 🇧🇪Belgium yazzbe
Similar to the issue detailed here:
https://www.drupal.org/project/facets/issues/3422150 💬 "Database exception" when using fulltext search with facet with AND operator ActiveThe SQL error in Search API occurs on views with both:
- A "full text search field" (e.g. on the title field)
- Facets linked to that view which have an AND operator (not OR)Switching the facet operator to OR eliminates the SQL error when using the full text search on title field.
- 🇦🇹Austria drunken monkey Vienna, Austria
drunken monkey → made their first commit to this issue’s fork.
- 🇦🇹Austria drunken monkey Vienna, Austria
Thanks a lot for reporting this problem!
After a bit of experimenting I was indeed able to reproduce it and write a test for it – I put it into this MR. Didn’t have time to develop a fix yet – the code is unfortunately pretty complex (as are the generated SQL queries), so it’s hard to fix this without breaking other functionality.Just one note: When reporting SQL errors it’s always very helpful if you note right away which database you are using. But it’s MySQL, correct?
- 🇧🇪Belgium yazzbe
Much appreciated for looking into this.
Yes, the database is MySQL 5.7.44.
Sorry for not mentioning that. - Status changed to Needs review
9 months ago 4:13pm 31 March 2024 - 🇦🇹Austria drunken monkey Vienna, Austria
I think I have it fixed now in the MR. Please test/review!
Incidentally, I now saw that I was actually wondering about the two lines I now deleted back when adding partial matching ten (!) years ago: #1299238-74: Add option for partial matching → . The one who wrote them couldn’t explain why they were there but since tests passed either way I decided to keep them in there.
- 🇧🇪Belgium yazzbe
I manually applied the change to version 1.3, and that completely resolved the issue for us.
Thank you very, very much for investigating this. I greatly appreciate your efforts in resolving it. It might have been a bit of an edge case. But the mystery of the 2 unknown lines of code is now solved :-)
Thanks!
- Status changed to RTBC
9 months ago 10:01am 2 April 2024 - Status changed to Fixed
9 months ago 11:11am 7 April 2024 - 🇦🇹Austria drunken monkey Vienna, Austria
Great to hear, thanks for testing!
Merged. Thanks again! -
drunken monkey →
committed e2a877c0 on 8.x-1.x
Issue #3436123 by drunken monkey, Yazzbe: Fixed incomplete GROUP BY when...
-
drunken monkey →
committed e2a877c0 on 8.x-1.x
Automatically closed - issue fixed for 2 weeks with no activity.