The query filter is in the format: title:*'XX1'* OR title:*'XX2'* with about 10 total title values all following this exact format. For some reason the specific number or combination of filters used causes the query to return 0 results, even though they are all separated by OR, so it should match at least some. Removing the last filter field makes it work for some reason.
It doesn’t say anything about using multiple wildcards, it just says wildcards are supported. One thing is there might be multiple words in the title. What if the title itself contains a keyword or operator? That’s why I thought it best to quote them. It’s been working fine up until now. But I’ll play around with it some more. I wonder if there will be issues with other fields as well, or just title.
I tried the new query, just like title:XX1 OR title:XX2 and it doesn’t work either. *’XXX’* behaves exactly the same in all cases it seems.
I’ve narrowed it down to the following that returns 0 products:
title:Bedding Set OR title:Advent Calendar
Without the OR, each one returns products on their own. It seems like a weird caching issue or something with the last term, since removing that from the whole query fixes it.
Hey @DavidT, the GraphQL Admin API includes a syntax debugger that shows exactly how your queries are being parsed. Every response includes an extensions.search object that breaks down the parsed query.
I tested your queries and here’s what the debugger revealed:
Your query:title:Bedding Set OR title:Advent Calendar
Without quotes, multi-word terms get misparsed. Set and Calendar are being searched in the default field instead of title, creating conflicting AND conditions.
One way I found that worked good is to use default field search (searches all fields):
Thanks, I couldn’t get it to work, but I see I just needed to set Shopify-Search-Query-Debug=1. I am testing the requests from Postman. It does seem the queries aren’t be parsed as I expected.
So is there no good way to do multi-word search queries? It seems there’s no way to ensure specific words come in the order they are listed if I have to search for each word individually.
I guess my only option is to use the default field instead, as you suggested, since that seems to support phrase queries.