Akash Kumar
03/18/2026, 9:57 AMranking_score field that should be automatically calculated using the following formula:
ranking_score = click + (add_to_cart * 2) + (purchase * 5)
What we need help with:
How can we automatically update this ranking_score field whenever new events are recorded?
• Is there a way to compute this dynamically within Typesense (e.g., via analytics rules or derived fields)?
• Or should this be handled externally (e.g., via backend cron/job or event pipeline)?
Goal:
We want ranking_score to always stay up-to-date and be used in:
sort_by: ranking_score:desc
Would appreciate your guidance on the best approach for this. as provided solution "message": "Rule event type cannot be changed" getting error for custom_event creation payload is {
"name": "book_click_custom",
"type": "counter",
"collection": "books_collection",
"event_type": "custom",
"params": {
"destination_collection": "books_collection",
"counter_field": "ranking",
"weight": 1
}
}Fanis Tharropoulos
03/18/2026, 11:30 AM