Hi all. I'm looking to implement a popularity coun...
# community-help
w
Hi all. I'm looking to implement a popularity counter event on my collections. I have a field with a popularity field:
Copy code
{
  "facet": false,
  "index": true,
  "infix": false,
  "locale": "",
  "name": "popularity",
  "optional": true,
  "sort": true,
  "stem": false,
  "type": "int32"
}
And a rule set up to count click events:
Copy code
{
  "name": "page_popularity",
  "params": {
    "destination": {
      "collection": "page",
      "counter_field": "popularity"
    },
    "limit": 1000,
    "source": {
      "collections": [
        "page"
      ],
      "events": [
        {
          "name": "page_click_event",
          "type": "click",
          "weight": 1
        }
      ]
    }
  },
  "type": "counter"
}
I can trigger a click event using:
Copy code
"name": "page_click_event",
  "type": "click",
  "data": {
    "q": "searching",
    "doc_id": "page_1451",
    "user_id": "***.***.**.**"
  }
}
And I get a response:
Copy code
"{\"ok\": true"
However, when querying the collection, I am not getting a popularity field and the counter does not seem to be adding anything to that document field. Can anyone see what I might be missing here? Using typesense 26.0. Thanks.