Optimizing JSON Data Import and Search with PHP Library
TLDR Arumugam experienced slow search results and data import time with json and PHP library. Kishore Nallan advised trying import and provided guidance on integrating the function into a PHP application. The issue was resolved as the search results are now displayed faster.
Jan 16, 2022 (20 months ago)
Arumugam
05:23 AMKishore Nallan
05:28 AMJan 17, 2022 (20 months ago)
Arumugam
04:23 AMKishore Nallan
03:10 PMArumugam
05:34 PMArumugam
05:37 PMJan 19, 2022 (20 months ago)
Arumugam
06:15 AMKishore Nallan
07:12 AMCan you add some logging to your code to see which exact call takes a long time? The code snippet above contains both document creation and search operations.
Kishore Nallan
07:13 AMArumugam
08:24 AMArumugam
08:24 AMKishore Nallan
08:25 AMArumugam
08:26 AMArumugam
08:27 AMGET ${TYPESENSE_HOST}/collections/:collection/documents/search
Arumugam
08:27 AMKishore Nallan
08:27 AMArumugam
08:32 AM[hits] => Array
(
[0] => Array
(
[document] => Array
(
[authors] => Array
(
[0] => J.K. Rowling
[1] => Mary GrandPré
)
[authors_facet] => Array
(
[0] => J.K. Rowling
[1] => Mary GrandPré
)
[average_rating] => 4.44
[id] => 2
[image_url] => https://images.gr-assets.com/books/1474154022m/3.jpg
[publication_year] => 1997
[publication_year_facet] => 1997
[ratings_count] => 4602479
[title] => Harrywww Potter and the Philosopher's Stone
)
[highlights] => Array
(
[0] => Array
(
[field] => title
[matched_tokens] => Array
(
[0] => Harrywww
)
[snippet] => <mark>Harrywww</mark> Potter and the Philosopher's Stone
)
)
[text_match] => 33514496
)
)
[out_of] => 9979
[page] => 1
[request_params] => Array
(
[collection_name] => books
[per_page] => 10
[q] => Harrywww
)
[search_cutoff] =>
[search_time_ms] => 0
)
Kishore Nallan
08:32 AMArumugam
08:33 AMArumugam
08:34 AMKishore Nallan
08:37 AMArumugam
08:39 AMKishore Nallan
08:41 AMArumugam
08:44 AMKishore Nallan
08:45 AMArumugam
08:45 AMKishore Nallan
08:45 AMArumugam
08:48 AMKishore Nallan
08:49 AMOr dump data from your DB periodically, convert to JSONL and index them into Typesense
Arumugam
08:50 AMArumugam
08:50 AMKishore Nallan
08:50 AMTypesense
Indexed 2764 threads (79% resolved)
Similar Threads
Issues with Importing Typesense Collection to Different Server
Kevin had problems migrating a Typesense collection between Docusaurus sites on different machines. Jason advised them on JSONL format, handling server hosting, and creating a collection schema before importing documents, leading to successful import.



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.

Troubleshooting Typesense Document Import Error
Christopher had trouble importing 2.1M documents into Typesense due to memory errors. Jason clarified the system requirements, explaining the correlation between RAM and dataset size, and ways to tackle the issue. They both also discussed database-like query options.


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.

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.

