#community-help

Troubleshooting 404 Error on Analytic Rule Creation in Typesense Cloud

TLDR Raz was getting a 404 error while creating an analytic rule in Typesense Cloud. Jason helped him to resolve the issue by suggesting an upgrade to the cluster version and flushing the DNS cache.

Powered by Struct AI

2

1

23
1mo
Solved
Join the chat
Oct 19, 2023 (1 month ago)
Raz
Photo of md5-5a7420e4ad0c38a564f96c2f58a05ea3
Raz
03:23 PM
Hey. I'm trying to create a new analytic rule but I'm getting { "message": "Not Found"}. I'm sure that the destination and source collections that I'm sending exist on the cloud. I'm sending popular_queries for the name and type. can you help me to understand why I'm getting 404, please? when do you return 404 for the POST url/analytics/rules endpoint? Thanks.
04:07
Raz
04:07 PM
On Typesense Cloud
We automatically set --enable-search-analytics=true and --analytics-flush-interval=300 (every 5 minutes) in Typesense Cloud (more context in the section above).

04:08
Raz
04:08 PM
is it possible that analytics to be disabled on cloud?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:21 PM
Could you share the full curl request that's throwing the 404?
04:21
Jason
04:21 PM
(minus the API key)
Raz
Photo of md5-5a7420e4ad0c38a564f96c2f58a05ea3
Raz
04:21 PM
sure
04:21
Raz
04:21 PM
curl -k "https://313asdfasfa31241.typesense.net/analytics/rules/" \
      -X POST \
      -H "Content-Type: application/json" \
      -H "X-TYPESENSE-API-KEY: " \
      -d '{
        "name": "popular_queries",
        "type": "popular_queries",
        "params": {
            "source": {
                "collections": ["products_v6"]
            },
            "destination": {
                "collection": "products_analytics_v1"
            },
            "limit": 1000
        }
      }'
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:23 PM
Looks like that cluster is running 0.24.0 which doesn't have the analytics feature.

You want to upgrade to v0.25.2.rc6 (Cluster Configuration > Modify). Could you do that and try again?
04:35
Jason
04:35 PM
Side note: v0.25.0 and v0.25.1 have a bug that prevents analytics from being collected... so you would have to upgrade to the above to get the search terms to be aggregated
Raz
Photo of md5-5a7420e4ad0c38a564f96c2f58a05ea3
Raz
04:35 PM
aaaa get it
04:35
Raz
04:35 PM
not sure if the typsense ruby library works with v0.25.2.rc6
Image 1 for not sure if the typsense ruby library works with v0.25.2.rc6
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:36 PM
That's the minimum version
Raz
Photo of md5-5a7420e4ad0c38a564f96c2f58a05ea3
Raz
04:36 PM
indeed, sorry
04:36
Raz
04:36 PM
I'll update it now to the last version

1

04:45
Raz
04:45 PM
Error (Typesense::Error::HTTPStatus0Error). maybe it's something wrong with the ruby client. I'll create the rule manually
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:45 PM
It's a DNS caching issue
04:45
Jason
04:45 PM
If you flush your DNS cache on your OS and try again, it should work
Raz
Photo of md5-5a7420e4ad0c38a564f96c2f58a05ea3
Raz
04:53 PM
perfect, it worked
04:53
Raz
04:53 PM
thanks a lot :mechanical_arm:

1

05:05
Raz
05:05 PM
should I add also a document to the destination collection?
05:05
Raz
05:05 PM
or will it be created automatically after a few searches?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:17 PM
You'd only need to create the destination collection with the schema mentioned in the docs. The documents will be auto-created by Typesense
Raz
Photo of md5-5a7420e4ad0c38a564f96c2f58a05ea3
Raz
05:21 PM
Great 🍻

1

Typesense

Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI

Indexed 3011 threads (79% resolved)

Join Our Community

Similar Threads

Query Suggestions for Search Feature on B2B eCommerce Site

arif needed guidance on implementing query suggestions for a B2B eCommerce website. Jason suggested using Typesense's native search query tracking. After some setup and discussion about delays, it was confirmed the system was working correctly.

14
4mo
Solved

Resolving Typesense Analytics "top_queries" Collection Issue

Zain faced issues with typesense analytics and an empty "top_queries" collection. Jason and Kishore Nallan assisted in troubleshooting, identified a bug, and suggested a fix in `0.25.0.rc66`. The fix worked for Zain.

3

29
3mo
Solved

Troubleshooting Typesense API Analytics Query Suggestions

Md was confused about implementing Typesense's Analytics Query Suggestions and experienced issues with collections returning no hits. Assistance from Kishore Nallan eventually led to the identification that analytics had to be enabled. They also discussed tracking duplicate and empty queries, resulting in Md creating a Github issue.

3

27
3mo
Solved

Typesense Capabilities and Troubleshooting Queries

A had issues with refinement lists and analytics in Typesense. Jason provided a possible solution and recommended the analytics widget. They clarified import size limits and helped identify a filter issue in A's query. Upgrade options are in Typesense's roadmap.

4

32
34mo
Solved

Optimizing Typesense Implementation for Large Collections

Oskar faced performance issues with his document collection in Typesense due to filter additions. Jason suggested trying a newer Typesense build and potentially partitioning the data into country-wise collections. They also discussed reducing network latency with CDN solutions.

5

67
11mo
Solved