0

Craft CMS 3.6.11.2 / Commerce 3.2.17.4

We have a Stores structure section that contains fields (searchable) such as phone, address, etc. These Stores are assigned as Entries (searchable, max of 1) to Commerce products.

When searching for products with a keyword that matches a Store phone, address, etc, none of these products are returned.

The search query is basic and as follows:

{% set search_query = '9999' %}
{% set products_query = craft.products.type('products').search(search_query) %}

So e.g., if 9999 is the phone number of a Store and we have Products that are assigned that Store, the search results return nothing.

Has anyone ever had this issue? Is there a specific query that can solve this?

1

In the case of relational fields, on the title of the related Assets/Categories/Entries is searchable.

As stated in the documentation:

For Matrix fields, the top-level Use this field’s values as search keywords setting determines whether any sub-fields will factor into results for the parent. For relational fields like Assets, Categories, and Entries, the setting determines whether related titles should factor into search results.

1
  • Thank you Oli. Just wondering whether the 'Use this field’s values as search keywords' setting will be taken for account for relational fields as well one of these days. I can see this as a really powerful feature as we can't jam every single keyword into the title in most cases. – biko Jun 21 at 22:52

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.