Exact search for more than 1 SKU

Hi, we need to use Algolia to show a list of products in a certain category. For this, we need to query Algolia with a list of SKUs and we need to get only those SKUs back as a search result. One of your competitors uses a search term like

SKU1||SKU2||SKU3||SKU4||SKU5

How can this be done in Algolia? Of course, we would turn off the typo tolerance for the attribute SKU.

Thanks for any hints
Jörg

having search queries with complicated syntax like this is not a situation in which a customer is empowered, we believe. You can however add a rule which filters on SKU (since it’s an uncommon word) like this:

{
  "conditions": [
    {
      "anchoring": "contains",
      "pattern": "{facet:sku}",
      "alternatives": false,
    }
  ],
  "consequence": {
    "params": {
      "automaticFacetFilters": [
        {
          "facet": "sku",
          "disjunctive": true
        }
      ],
      "query": {
        "edits": [
          {
            "type": "remove",
            "delete": "{facet:sku}"
          }
        ]
      }
    },
    "filterPromotes": true
  },
  "enabled": true,
  "description": "filters on sku strictly",
  "objectID": "filter-sku"
}

Hope that makes sense!

Thanks, we will look into this. To be specific: We will create the query programmatically when opening a certain product category. My question was, if || or something else will help to list a number of terms for non-tolerant fields and make sure that those articles (no more, no less) are returned.

Ah, if it’s a programmatic query, that actually changes the situation slightly. That means you can arbitrarily create any query and apply this via filters:

{
  "filters": "objectID:SKU1 OR objectID:SKU2 OR objectID:SKU3 OR objectID:SKU4 OR objectID:SKU5",
}

This can also be done with facetFilters, but if you’re InstantSearch, this could conflict with one of the widgets, while filters is always up to you!