#community-help

Integrating Typesense API with Existing Set-up

TLDR Mubashirullah needed help with converting an API request to a typesense query and considered using an intermediary service. Kishore Nallan suggested running Typesense from the frontend unless session handling or authentication logic required a middleware service.

Powered by Struct AI

1

5
23mo
Solved
Join the chat
Dec 22, 2021 (23 months ago)
Mubashirullah
Photo of md5-cea7a558edb0c66a1c07dfdcf00bc141
Mubashirullah
07:08 AM
I've coded most of what we need. Now I just need to change the current api with the typesense one. I need to convert the below request and map it into an equivalent search query. Is there a better way? I'm thinking of using API Gateway (AWS) to send the below to a lambda that will then do the search from typsense which I will place in an ECS cluster.
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
07:09 AM
Typesense can be directly exposed to the front end as well.
Mubashirullah
Photo of md5-cea7a558edb0c66a1c07dfdcf00bc141
Mubashirullah
07:14 AM
Were can I read more about it. I don't know what would be a better approach. Modifying the frontend to talk to typsense or having something in the middle that will convert the current format to a typsense one
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
07:15 AM
If you have additional session handling or auth logic, then running through a middleware service is better, but the advantage of running from the front end is that it is one less hop so you save on some latency.

> Were can I read more about it.
Read up the JS client examples in the docs.

1

Mubashirullah
Photo of md5-cea7a558edb0c66a1c07dfdcf00bc141
Mubashirullah
01:29 PM
I'm going for the middle man approach. Since I'm composing the search query for filter_by, is it ok to add && without anything else that comes after it?
I've tried it and it didn't give me an error