Got it all running, but will share my experience setting it up, maybe it helps someone.
Running 1.5.7c on php 7.4.33
Typesense installed on a cloud vps with 8GB ram and 4 vCPUs (should be plenty of resources)
I was getting a lot of php version related errors due to dependencies so I had to downgrade Monolog (https://github.com/Seldaek/monolog/releases/tag/2.9.1) and psr/log (https://github.com/php-fig/log/releases/tag/1.1.4)
There's 16k products and 1500 categories. Cron job is set to run every 5 minutes as per docs but when I run a Full Sync but it never gets to complete it - it always comes to around 6k products within the 5 minutes and the log shows "Last sync is still running. Exiting.". No matter what I do, I'm stuck in this loop and can't seem to complete a Full Sync, and my Typesense dashboard remains red for Collection (No Collections Found, Run a Full Sync).
Code:
2023-07-02 14:00:11 [DEBUG] --- Starting Full-Sync of Typesense collections ---
2023-07-02 14:00:11 [DEBUG] Creating products collection supers_zc157_products_1688302811
2023-07-02 14:00:12 [DEBUG] Begin indexing products collection supers_zc157_products_1688302811
2023-07-02 14:00:21 [DEBUG] Indexing products 1 to 100 (of 16027)
2023-07-02 14:00:23 [DEBUG] Indexing products 101 to 200 (of 16027)
2023-07-02 14:00:25 [DEBUG] Indexing products 201 to 300 (of 16027)
2023-07-02 14:00:29 [DEBUG] Indexing products 301 to 400 (of 16027)
2023-07-02 14:00:31 [DEBUG] Indexing products 401 to 500 (of 16027)
2023-07-02 14:00:33 [DEBUG] Indexing products 501 to 600 (of 16027)
2023-07-02 14:00:36 [DEBUG] Indexing products 601 to 700 (of 16027)
2023-07-02 14:00:38 [DEBUG] Indexing products 701 to 800 (of 16027)
2023-07-02 14:00:41 [DEBUG] Indexing products 801 to 900 (of 16027)
2023-07-02 14:00:45 [DEBUG] Indexing products 901 to 1000 (of 16027)
2023-07-02 14:00:48 [DEBUG] Indexing products 1001 to 1100 (of 16027)
2023-07-02 14:00:51 [DEBUG] Indexing products 1101 to 1200 (of 16027)
2023-07-02 14:00:54 [DEBUG] Indexing products 1201 to 1300 (of 16027)
2023-07-02 14:00:56 [DEBUG] Indexing products 1301 to 1400 (of 16027)
2023-07-02 14:00:58 [DEBUG] Indexing products 1401 to 1500 (of 16027)
2023-07-02 14:01:03 [DEBUG] Indexing products 1501 to 1600 (of 16027)
2023-07-02 14:01:05 [DEBUG] Indexing products 1601 to 1700 (of 16027)
2023-07-02 14:01:07 [DEBUG] Indexing products 1701 to 1800 (of 16027)
2023-07-02 14:01:09 [DEBUG] Indexing products 1801 to 1900 (of 16027)
2023-07-02 14:01:12 [DEBUG] Indexing products 1901 to 2000 (of 16027)
2023-07-02 14:01:15 [DEBUG] Indexing products 2001 to 2100 (of 16027)
2023-07-02 14:01:17 [DEBUG] Indexing products 2101 to 2200 (of 16027)
2023-07-02 14:01:20 [DEBUG] Indexing products 2201 to 2300 (of 16027)
2023-07-02 14:01:23 [DEBUG] Indexing products 2301 to 2400 (of 16027)
2023-07-02 14:01:25 [DEBUG] Indexing products 2401 to 2500 (of 16027)
2023-07-02 14:01:28 [DEBUG] Indexing products 2501 to 2600 (of 16027)
2023-07-02 14:01:31 [DEBUG] Indexing products 2601 to 2700 (of 16027)
2023-07-02 14:01:33 [DEBUG] Indexing products 2701 to 2800 (of 16027)
2023-07-02 14:01:35 [DEBUG] Indexing products 2801 to 2900 (of 16027)
2023-07-02 14:01:38 [DEBUG] Indexing products 2901 to 3000 (of 16027)
2023-07-02 14:01:40 [DEBUG] Indexing products 3001 to 3100 (of 16027)
2023-07-02 14:01:43 [DEBUG] Indexing products 3101 to 3200 (of 16027)
2023-07-02 14:01:46 [DEBUG] Indexing products 3201 to 3300 (of 16027)
2023-07-02 14:01:48 [DEBUG] Indexing products 3301 to 3400 (of 16027)
2023-07-02 14:01:50 [DEBUG] Indexing products 3401 to 3500 (of 16027)
2023-07-02 14:01:52 [DEBUG] Indexing products 3501 to 3600 (of 16027)
2023-07-02 14:01:55 [DEBUG] Indexing products 3601 to 3700 (of 16027)
2023-07-02 14:01:57 [DEBUG] Indexing products 3701 to 3800 (of 16027)
2023-07-02 14:02:00 [DEBUG] Indexing products 3801 to 3900 (of 16027)
2023-07-02 14:02:02 [DEBUG] Indexing products 3901 to 4000 (of 16027)
2023-07-02 14:02:06 [DEBUG] Indexing products 4001 to 4100 (of 16027)
2023-07-02 14:02:08 [DEBUG] Indexing products 4101 to 4200 (of 16027)
2023-07-02 14:02:11 [DEBUG] Indexing products 4201 to 4300 (of 16027)
2023-07-02 14:02:15 [DEBUG] Indexing products 4301 to 4400 (of 16027)
2023-07-02 14:02:17 [DEBUG] Indexing products 4401 to 4500 (of 16027)
2023-07-02 14:02:20 [DEBUG] Indexing products 4501 to 4600 (of 16027)
2023-07-02 14:02:25 [DEBUG] Indexing products 4601 to 4700 (of 16027)
2023-07-02 14:02:29 [DEBUG] Indexing products 4701 to 4800 (of 16027)
2023-07-02 14:02:33 [DEBUG] Indexing products 4801 to 4900 (of 16027)
2023-07-02 14:02:38 [DEBUG] Indexing products 4901 to 5000 (of 16027)
2023-07-02 14:02:40 [DEBUG] Indexing products 5001 to 5100 (of 16027)
2023-07-02 14:02:43 [DEBUG] Indexing products 5101 to 5200 (of 16027)
2023-07-02 14:02:48 [DEBUG] Indexing products 5201 to 5300 (of 16027)
2023-07-02 14:02:52 [DEBUG] Indexing products 5301 to 5400 (of 16027)
2023-07-02 14:02:54 [DEBUG] Indexing products 5401 to 5500 (of 16027)
2023-07-02 14:02:56 [DEBUG] Indexing products 5501 to 5600 (of 16027)
2023-07-02 14:03:06 [DEBUG] Indexing products 5601 to 5700 (of 16027)
2023-07-02 14:03:11 [DEBUG] Indexing products 5701 to 5800 (of 16027)
2023-07-02 14:03:17 [DEBUG] Indexing products 5801 to 5900 (of 16027)
2023-07-02 14:03:19 [DEBUG] Indexing products 5901 to 6000 (of 16027)
2023-07-02 14:03:22 [DEBUG] Indexing products 6001 to 6100 (of 16027)
2023-07-02 14:03:29 [DEBUG] Indexing products 6101 to 6200 (of 16027)
2023-07-02 14:05:10 [DEBUG] Last sync is still running. Exiting.
I'm also getting an myDEBUG-adm error that was never before in the logs:
Code:
[02-Jul-2023 14:03:30 Europe/London] PHP Fatal error: Maximum execution time of 60 seconds exceeded in /home/supers/public_html/includes/classes/class.base.php on line 198
[02-Jul-2023 14:03:30 Europe/London] Request URI: cron, IP address: cron
--> PHP Fatal error: Maximum execution time of 60 seconds exceeded in /home/supers/public_html/includes/classes/class.base.php on line 198.
Seems to be related to the admin config for max_execution_time so I've increased that to 600 (admin->Configuration->My Store) and have set the cron job to run every 15 minutes. That actually seems like an overkill because the products and/or categories don't change that often - I'm thinking it would be better to set it to once per hour to reduce server load?
Everything is finally working as expected, Typesense is picking up spelling errors and seems to be returning more relevant search results. Can't wait to play around with synonyms to see the long-term effect.
So far, I'm liking it a lot, but it would be great if the results could be passed to the advanced_search_results (search_results for 1.5.8) page instead of instant_search_result - what's the point of having both pages accessible with different results?
Will report back when there's some feedback and when we see how it actually works in production.
Bookmarks