Hello, we are using Typesense Cloud and are having...
# community-help
i
Hello, we are using Typesense Cloud and are having troubles getting Analytics Rules to work. We've created a collection as follows:
Copy code
{
  "name": "search_queries",
  "fields": [
    {
      "name": "q",
      "type": "string"
    },
    {
      "name": "filter_by",
      "type": "string"
    },
    {
      "name": "count",
      "type": "int32"
    }
  ]
}
And the created a rule:
Copy code
{
  "rules": [
    {
      "name": "popular_queries",
      "params": {
        "source": {
          "collections": [
            "inquiries",
            "orders"
          ]
        },
        "destination": {
          "collection": "search_queries"
        },
        "expand_query": false,
        "limit": 1000
      },
      "type": "popular_queries"
    }
  ]
}
No documents are added to the collection
search_queries
.
analytics-flush-interval: 300
is set. Any help would be greatly appreciated.
f
How long after the rule creation have there no documents been indexed into the destination collection?
i
Thanks for the reply. It's been more than 24 hours.
We just found out something: When the
filter_by
field is made optional, documents get added. It seems there's a problem with the
"meta_fields": ["filter_by"]
parameter for the rule 🤔
The
meta_fields
parameter is also not part of the response of
GET /analytics/rules
, though it seems it can be set.
f
Could you guide me through your workflow? Why do you use the filter_by meta field and what each collection is set up for and what requests you're sending out to typesense?
i
Our use case is a simple one: • We have two collections (
inquiries
and
orders
) and offer users to search (
q
) and filter (
filter_by
,
facet_by
) these collections separetely. • We want to find out if (i.e. how often) users combine a search term (
q
) with filterting (
filter_by
). • The idea was to set up an Analytics Rule that includes
q
and
filter_by
(so we can find out if any popular requests contain both).
f
Could you create a reproducible example similar to this one so we can debug?
i
Hi @Fanis Tharropoulos. We'd love to provide more details, but I'm afraid it's not currently possible due to time constraints 😐 Anyway, thanks for your interest and help!