Optimizing Uploads to Typesense and Dealing with Hits Limit
TLDR Masahiro asked how to upload documents to Typesense faster and about their search feature limit_hits. Jason suggested batching documents and debugged the search query. Issue was resolved.
1
Apr 25, 2021 (33 months ago)
Masahiro
06:18 AMI have 3 questions.
1. Faster way to upload documents to Typesense. (Iโm okay with uploading speed now, but if possible I wanna make it faster.)
2.
3. limit_hits did not work. search request retrieves all documents.
Iโd appreciate it if you could answer my questions๐
Jason
08:42 PMJason
08:44 PMJason
08:45 PMApr 26, 2021 (33 months ago)
Masahiro
12:18 AM2. wow-cool. Wny not mention in the table? ๐
3. This is the query I did
const searchRequests = {
searches: [
{
collection: 'users',
q: `${ids}`,
query_by: 'userId',
limit_hits: 10,
page: 1,
per_page: 10
}
]
};
try {
const result = await client.multiSearch.perform(searchRequests);
console.log(result);
// console.log(result['results'][0]['hits']);
} catch (e) {
cons
Jason
02:26 AM2. It's mentioned very lightly in the table as "Fault Tolerance" . I'll update it to make it clearer.
3. What happens when you change page to 2 in the same query?
1
Masahiro
04:56 AMso, I tried with this query, but did not work.
{
collection: โusersโ,
q:
${ids}
,query_by: โuserIdโ,
page: 2,
per_page: 10
}
Masahiro
05:11 AMthanks it solved!!
Jason
05:21 AMTypesense
Indexed 3011 threads (79% resolved)
Similar Threads
Moving from Algolia to Typesense: Questions and Answers
Juan sought advice from Kishore Nallan about moving from Algolia to Typesense, handling MultiSearch, setting parameters, checking imported documents, and a specific syntax query.
Querying with Not-in in Typesense
Masahiro inquired about using not-in queries in Typesense. Kishore Nallan explained how to conduct such queries by using the "-" operator in the query string, and assisted Masahiro with issues stemming from a high number of exclusion tokens. The problem was eventually resolved by switching to the `multi_search` endpoint.
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.
Retrieving All Documents: Challenges and Considerations
Masahiro asked about retrieving all documents in one query. Harisaran suggested increasing the `per_page` parameter. Kishore Nallan clarified that getting all results is possible via pagination or export, but implementing query + export feature is in the backlog. It was also discussed that extensively scrolling through search results can cause slower performance.
Increase Search Result Size and Filter Special Characters
Anton requested pagination beyond 250 hits per page and precise filtering for terms with special characters. Jason suggested multi-search as a workaround and planned to address special character filtering in an upcoming release. A Github issue was created to track this feature request.