Use custom query to select specific products or variants
Before deep diving into the example use case, we will give general knowledge about the parameters that can be used to query at the search bar in the Specific Products and Specific Variants option.
There are 16 types of parameters that you can use for "Specific Products" query.
Now, let's dive into the example use case:
1. Search Products or Variants by a specific vendor
so let's say we want to search products by vendor, we can use a query like this "vendor:your_vendor_name", see the example below
2. Search Products or Variants by a specific pattern
in this use case, let's say we want to search title that has a prefix "Airbus-1", we can use asterisk(*) for this case. Please see the example below
So, as you can see all the title that contains "Airbus-1xxx" will be listed. You can also implement this if you want to search by the suffix of the title.
3. Range Search
A range search specifies a range of values to search against. Supported operators are
The following query matches documents where the
inventory_quantity field is greater than 100 and less than or equal to 160:
query= inventory_quantity:>100 AND inventory_quantity:<=160
4. Field Search
Field searches apply to terms in specific fields.
The following query searches for "shirt" in the tag field AND "adidas" in the vendor field:
query= tag:shirt AND vendor:adidas
The value must immediately follow the field with no whitespace.
There are some of the use cases that you can use to search for the products or variants. You can use it based on your needs.
If you have any questions, please kindly write us an email to our support at firstname.lastname@example.org