There seems to be a bug when I combine non-ascii characters, quotes and the OR operator when searching.

All of these queries work ok:

  • "pølser"
  • "pålegg"
  • pølser OR pålegg
  • "egg" OR "spekemat"


  • "pølser" OR "pålegg"

always returns no result.

The search form uses roughly this code:

{% set searchTerm = craft.request.getParam('search') %}

{% set entries = craft.entries %}

... entries is optionally limited to a single section here, but it makes no difference here ... 

{% set entries = entries.search(searchTerm) %}

Any ideas?


(cross-posted from google+ group as I only just found out about the stack-exchange)

(edit to add code sample)

  • You mean when searching entries with ElementCriteriaModel? Would you mind adding an example code snippet for context?
    – Matt Stein
    Jun 18 '14 at 14:56
  • Does rebuilding the search indexes help? Jul 3 '14 at 6:40

This looks like a bug to me too. Here are the search terms and generated queries:

'pølser OR pålegg' -
   SELECT * FROM `craft_searchindex` WHERE (MATCH(`keywords`) AGAINST('pølser palegg' IN BOOLEAN MODE)) AND `elementId` IN (3,18,21,22,23,24)

'"pølser" OR "pålegg"' -
   SELECT * FROM `craft_searchindex` WHERE (`keywords` LIKE '% pølser or %') AND MATCH(`keywords`) AGAINST('+palegg' IN BOOLEAN MODE) AND `elementId` IN (3,18,21,22,23,24)

'"egg" OR "spekemat"' -
   SELECT * FROM `craft_searchindex` WHERE ((`keywords` LIKE '% egg %') OR MATCH(`keywords`) AGAINST('spekemat' IN BOOLEAN MODE)) AND `elementId` IN (3,18,21,22,23,24)
  • Looks like a bug with multibyte strings in the search query parser. Thanks for posting that – I’ll look into it. Jul 3 '14 at 21:52
  • 2
    Yep… fixed for the next release! Jul 3 '14 at 23:26
  • Nice answer Marion!
    – Anna_MediaGirl
    Jul 4 '14 at 5:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.