#community-help

Improving Search Time in Typesense

TLDR Vasudev sought for ways to improve server response time in Typesense. Kishore Nallan suggested it might be network latency or Postman's request process. Harrison confirmed that Postman is usually slow.

Powered by Struct AI

1

29
15mo
Solved
Join the chat
Oct 05, 2022 (15 months ago)
Vasudev
Photo of md5-591a0ac3f5f7ef9eb6e6fc35534beeae
Vasudev
04:21 AM
Can you suggest something to make it possible in 1 or 2 ms
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
04:52 AM
Are you talking about the /collections/:name/documents/:id endpoint?
Vasudev
Photo of md5-591a0ac3f5f7ef9eb6e6fc35534beeae
Vasudev
04:53 AM
Yes
04:53
Vasudev
04:53 AM
I need to implement searchAPI i guess
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
04:53 AM
What version of Typesense are you using and how big is your collection?
Vasudev
Photo of md5-591a0ac3f5f7ef9eb6e6fc35534beeae
Vasudev
04:54 AM
Latest version of typesense
And it has only 3 records
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
04:55 AM
Is this 300 ms the value in the search_time_ms in the response?
Vasudev
Photo of md5-591a0ac3f5f7ef9eb6e6fc35534beeae
Vasudev
04:55 AM
No, postman request response time
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
04:56 AM
How far is your server from your local machine? It could just be network latency. Check the value of that field to see actual time taken by Typesense to fetch the document.
Vasudev
Photo of md5-591a0ac3f5f7ef9eb6e6fc35534beeae
Vasudev
04:57 AM
Okay I'll look into it
04:58
Vasudev
04:58 AM
${TYPESENSE_HOST}/collections/:collection/documents/search

Is this api is triggered when we are typing something in UI
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
05:00 AM
That's the search API not, "get data by specific id" as you mentioned earlier.
Vasudev
Photo of md5-591a0ac3f5f7ef9eb6e6fc35534beeae
Vasudev
05:01 AM
Okay
06:05
Vasudev
06:05 AM
in SearchAPI i am getting "search_time_ms": 0 but postman is showing 300ms
06:05
Vasudev
06:05 AM
this delay is from postman?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
06:06 AM
How far geographically is your server?
Vasudev
Photo of md5-591a0ac3f5f7ef9eb6e6fc35534beeae
Vasudev
06:07 AM
around 700km
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
06:08 AM
Then the issue must be with postman. Maybe they are proxying your request? Try querying using curl or another language client to measure time taken.
Vasudev
Photo of md5-591a0ac3f5f7ef9eb6e6fc35534beeae
Vasudev
06:08 AM
okay
06:09
Vasudev
06:09 AM
/collections/:name/documents/:id for this endpoint there is no such field "search_time_ms"
06:10
Vasudev
06:10 AM
but for searchAPI it is available..
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
06:10 AM
Because that endpoint is usually instant
Vasudev
Photo of md5-591a0ac3f5f7ef9eb6e6fc35534beeae
Vasudev
06:14 AM
okay
06:14
Vasudev
06:14 AM
and can we use id in query_by
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
06:15 AM
It can be used in filter_by, not query_by though we want to add that support
Vasudev
Photo of md5-591a0ac3f5f7ef9eb6e6fc35534beeae
Vasudev
06:15 AM
okay thanks
07:03
Vasudev
07:03 AM
Is there any way to encrypt every collection present ?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
07:16 AM
Typesense Cloud encrypts data at rest on the disk.
Harrison
Photo of md5-43a35158b04c9c49110114370dbeae06
Harrison
01:01 PM
Postman is notoriously slow network processing wise.

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

Discussing Typesense Search Request Performance

Al experienced longer-than-reported times for Typesense search requests, sparking a detailed examination of json parsing, response times and data transfer. Jason and Kishore Nallan helped solve the issue.

2

37
32mo
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

Revisiting Typesense for Efficient DB Indexing and Querying

kopach experienced slow indexing and crashes with Typesense. The community suggested to use batch import and check the server's resources. Improvements were made but additional support was needed for special characters and multi-search queries.

1

46
9mo
Solved

Troubleshooting Indexing Duration in Typesense Import

Alan asked about lengthy indexing times for importing documents to Typesense. Jason suggested various potential causes, including network connectivity and system resources. They later identified the problem to be an error in Alan's code.

5

43
15mo
Solved

Typesense Server Bulk Import/Upsert Issue Resolved

Adam was confused about the discrepancy between the successful responses and the actual indexed data while working with a custom WP plugin integrating with Typesense. The issue was a bug related to fetching documents in the wrong order, not a Typesense problem.

2

22
7mo
Solved