I am getting unexpected results when I search for a Commerce product. Let's say I have a product that has category fields call 'Sport' And 'Award Type'.

I have a product that has Football & Trophy populated in those two fields.

I query craft.products().search('football trophy').

Craft returns zero entries. This is the query Craft creates for MySQL:

SELECT * FROM `searchindex` WHERE MATCH(`keywords`) AGAINST('+football* +trophy*' IN BOOLEAN MODE) AND `siteId` = '1'

I would assume it's because the search is looking for both Football and Trophy on one index line. Is it even possible to get the results I want?

Your Answer

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

Browse other questions tagged or ask your own question.