Skip to content

Pin or hide results

A custom result sets the results of a query by hand. Pin a hero product on top of dress, hide the wrong category from boots, show only gift cards for gift card, or send sale to your sale page. Nothing automatic outranks it.

  1. Open Collections → your collection → Custom results and click Add rule.

  2. Under When users search for…, type a term, pick Contains or Exact, and click Add. Add more terms if several queries should fire the rule.

  3. Under Pin or hide documents, open Pin or Hide and click Add documents. Search by title, ID or category, tick the documents, and click Pin n documents or Hide n documents.

  4. Drag the pinned documents into order. The first one tops the results.

  5. Under How should results appear?, pick Pinned first or Pinned only. This step shows once something is pinned.

  6. Under Redirect to a page (optional), paste a page’s full address to send the query there.

  7. Under When is the rule live?, keep Always on, or pick the first and last day.

  8. Click Create rule.

The Add custom result rule dialog: When users search for, Pin or hide documents, and When is the rule live
The Add custom result rule dialog

Instead of picking documents one by one, set conditions under Also pin every product where or Also hide every product where. The set stays current: a product added to the category tomorrow joins without an edit.

  • Pin category is Cement for cement.
  • Show only sale price ≥ 1 for offers, with Pinned only.
  • Hide brand is Acme from resin.
A custom result rule for reading lamp: under Also pin every product where, category is Table Lamps and Wall Lamps & Sconces, ticked in the value list with the count beside each value, and 423 products match
A rule that pins two categories
CaseWhat happens
Fields and valuesPick a field to see its values with how many documents carry each. Tick several to match any of them, or type one the list lacks.
Numbers and yes/noNumbers take =, ≠, >, ≥, <, ≤. Yes/no fields take Yes or No.
Several conditionsAll of them must hold. The count under them shows how many products match now.
The query’s wordsNot needed: a picked document shows even without them. A rule is your choice of results, not a filter on the search’s.
Text fieldsTitles and descriptions can’t be used: they are searched, not compared.
CaseWhat happens
Pinned one by oneCome first, in your order.
Pinned by a ruleCome next, most popular first.
Pinned firstThe default. Search results follow on every page, without repeating a pinned document.
Pinned onlyOnly pinned documents show.
HiddenGone from the results of these queries.
ContainsFires when the query contains the term anywhere, even inside a word: ring also fires for earrings.
ExactFires when the whole query is the term, in any letter case.
DatesThe rule is live from the start of the first day to the end of the last, in your local time.
PausingThe Active switch in the list pauses a rule without deleting it.
LimitsUp to 100 terms per rule and 500 documents per list.
CaseWhat happens
Pressing EnterThe search widget opens the page. While the visitor types, results show as usual.
The addressA full address that starts with https:// or http://.
Redirect onlyA rule can redirect without pinning or hiding anything. The list marks it with the page’s domain.
Several rulesThe most specific rule that has a redirect sends the query, in the order below.
Your own codeSearch responses carry the address in redirect. Your code decides when to go there.

A query can fire several rules, say a broad Contains rule for a category and a focused one for one term. Only the most specific rule pins:

  1. An Exact match beats a Contains match.
  2. A longer matched term beats a shorter one.
  3. Then the rule with fewer terms wins.

Documents that any matching rule hides stay hidden. If a broad rule takes the top spot from a focused one, narrow the broad rule or give the focused one an Exact term.

Export downloads the collection’s rules as a JSON file. Import adds the rules from such a file as new rules, up to 500 per file. Prepare a campaign’s rules offline, copy them to another collection, or keep them in a repository.

For developers: a custom result lives on /v1/collections/{id}/curations with queries, pin, hide, pinnedOnly and redirectUrl. pin and hide are { ids, filter }: ids are document ids as search returns them, pinned in order. filter is the search filter without contains. enabled, startsAt and endsAt pause a rule or limit it to dates.

Type the trigger on Test your search, then a near miss. Pins should sit in your order, and a Contains term shouldn’t fire wider than you meant.

Next: start with your most frequent searches in Search performance, or boost results by their attributes.