Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2021
    Posts
    41
    Plugin Contributions
    2

    Default Typesense plugin (Instant Search add-on) Support Thread

    >>> READ THE README BEFORE ASKING! It explains how Typesense works, how to fix sync errors and other FAQs! <<<

    Please don't ask for support on how to install/set-up the Typesense server. If you need help with that, please refer to the Typesense guide. This thread is only for support regarding the synchronization with the Zen Cart catalog and the Instant Search feature.


    This plugin is an add-on for the Instant Search plugin and allows to use Typesense as a search engine (in place of MySQL).
    Features:

    • Faster searches and more accurate results than MySQL, including typo tolerance and synonyms.
    • Automatic synchronization of the Zen Cart catalog (products, categories an brands) with Typesense.
    • Includes a basic dashboard in the Zen Cart admin to monitor sync status, view Typesense server status and collections, and manage synonyms.
    • Automatic fallback to MySQL if the Typesense server is not available.


    GitHub repository: https://github.com/marco-pm/zencart_typesense

    Instant Search plugin 4.0.0 or higher must be installed first.

    Read the plugin readme for everything you want to know and more!


    Please note that this plugin is not sponsored by or affiliated with Typesense in any way.
    There are many excellent search engines out there. I chose Typesense for several reasons, including: open source, fast, excellent documentation, well maintained, simple to use, ability to self-host it for free, very affordable pricing plans if you choose to use their cloud server.

  2. #2
    Join Date
    Jun 2021
    Posts
    41
    Plugin Contributions
    2

    Default Re: Typesense plugin (Instant Search add-on) Support Thread

    In the github repo you will find the Beta release 1.0.0 (don't forget to download also the vendor files!).
    It would be extremely helpful if any of you could try installing it and let me know about any bugs, as well as general feedback on the plugin.

    If you own a VPS/cloud server you can install Typesense very easily and for free. Otherwise you can try Typesense Cloud, there is a free initial trial up to a certain amount of bandwidth/hours.

    If everything seems to work properly I'll remove the "Beta" tag and submit it to the plugin sections here.

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,478
    Plugin Contributions
    88

    Default Re: Typesense plugin (Instant Search add-on) Support Thread

    Wow! Very, very well put together. I'll be giving it a spin soon.

  4. #4
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,684
    Plugin Contributions
    123

    Default Re: Typesense plugin (Instant Search add-on) Support Thread

    thanks for your hard work on this @marcopm.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  5. #5
    Join Date
    Jun 2021
    Posts
    41
    Plugin Contributions
    2

    Default Re: Typesense plugin (Instant Search add-on) Support Thread

    If you don't have manufacturers, make this change to avoid an error during the sync.

    This fix wil be included in the next release.

  6. #6
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,542
    Plugin Contributions
    19

    Default Re: Typesense plugin (Instant Search add-on) Support Thread

    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.

  7. #7
    Join Date
    Jun 2021
    Posts
    41
    Plugin Contributions
    2

    Default Re: Typesense plugin (Instant Search add-on) Support Thread

    Quote Originally Posted by balihr View Post
    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)
    Thank you for reporting the error and the solution, I will add this tip to the docs.


    Quote Originally Posted by balihr View Post
    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?
    Once the Full-Sync has been completed, for the next 12 hours (or the value configured in the settings) the cron job will only perform an Incremental-Sync. It will only scan the products table for products that have been updated since the last sync, so if there are no changes it will just exit without doing anything.
    Therefore you can keep the cron job every 5 minutes, it shouldn't affect the server load. Of course if products don't change often you can set it to every 15 or 30 minutes like you did, just keep in mind that the search results may not be up-to-date for (worst case) 15-30 minutes.

 

 

Similar Threads

  1. Support Thread for CKEditor Plugin
    By DivaVocals in forum Addon Admin Tools
    Replies: 201
    Last Post: 31 Aug 2021, 05:14 PM
  2. Back to Top Plugin [Support Thread]
    By picaflor-azul in forum All Other Contributions/Addons
    Replies: 31
    Last Post: 6 Feb 2016, 10:52 PM
  3. Justuno Plugin [Support Thread]
    By JustunoApp in forum All Other Contributions/Addons
    Replies: 8
    Last Post: 24 May 2015, 11:00 PM
  4. VendingBox Plugin Support Thread
    By vb_support in forum All Other Contributions/Addons
    Replies: 31
    Last Post: 10 Feb 2013, 07:24 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR