Arrow right icon Arrow up icon Activity icon Analytics icon Phone icon Caret down icon Caret left icon Caret right icon Caret up icon Checkmark Servers cluster icon Cross icon Devices icon Discover symbol icon Find symbol icon Inspire symbol icon Iphone icon Lock icon Open lock icon Lock icon Magnifying glass icon Mac icon No network icon Multi cluster icon Menu icon Minus icon Partners icon Personalization icon Plus icon Question icon Search API icon Server icon Shield icon Triangle-right icon Triangle-left icon Triangle-right icon Vault icon Fr Flag Us Flag

Discover Query Rules

Create a smarter, more natural search experience.

Query Rules allows you to enhance the ranking behavior of the engine for specific queries. You can set up rules to uncover and respond more specifically to the intent behind your users' queries.

Promote Results

Query rules illustration 1

Modify search ranking and promote specific results into desired positions.

Query-Based Alerts

Query rules illustration 2

Add promotional banners to alert users to offers and promotions relevant to their search queries.

Translate Intent

Query rules illustration 3

Guide users to the perfect result quickly with an as-you-type faceting experience

With Query Rules, you can promote, filter, and develop thousands of automatic triggers & rules based on context only you know to make sure your users get connected with what matters most.

Code with confidence

The what-is and how-to of the Query Rules API. Overviews, use cases, tutorials, code snippets, and a full tech reference - Everything you'll need to get started coding.

Query Rules Docs
Javascript
// Promote 2 star trek objects when a query contains Star Wars
index.saveRule({
  objectID: "promoteStarTrek",
  condition: { pattern: "Star Wars", anchoring: "contains" },
  consequence: {
    promote: [
      { objectID: "5588602", position: 1 },
      { objectID: "3447500", position: 3 }
    ]
  }
});

Do it visually

Access the “if this then that” Query Rules builder from within the Algolia Dashboard to start building your first rules today.

Login
Query rules comp screens qr