Skip to main content

Attribute ranking

An attribute ranking query returns the best attribute values for a given user. Instead of ranking items, this ranks attribute values like categories, genres, brands, or tags.

Common applications include:

  • Personalized category carousels ("Top categories for you")
  • Navigation that adapts to user preferences
  • Surfacing relevant filters or facets

Rank attributes for user

Prerequisites

  1. An engine with item data containing the attribute you want to rank
  2. A user_id to personalize for

Query example

Use the rank_attributes query type to find the best attribute values for a user:

{
"query": {
"type": "rank_attributes",
"input_attribute": "category",
"input_user_id" : "12345",
"embeddings": "content_embedding",
"limit": 5
}
}