Instant Search

Views: 59,246

Results 221 to 240 of 262
17 Feb 2024, 10:48 AM
#221
billj avatar

billj

New Zenner

Join Date:
Sep 2013
Location:
Devon, UK
Posts:
88
Plugin Contributions:
1

Instant Search

Using Zen Cart 1.58a and PHP 8.1 I have occasionally seen huge numbers of the following error logged, usually within the space of 1 or 2 seconds:

PHP Warning: mysqli_connect(): (42000/1203): User saabcom_zencart already has more than 'max_user_connections' active connections in /home/saabcom/saabits.com/includes/classes/db/mysql/query_factory.php on line 76.

When this happens, of course the user sees nddbc.html ("problem connecting to our database") and can't do anything.

Sometimes there is more information showing which function was trying to access the database but it varies and I'm not sure any of them are relevant. It looks like something is hitting the database really hard and locking everything else out. I have the Typesense plug-in installed and I'm not sure if that is the culprit or not. I wondered if the full-sync was doing it since we have about 18,000 products and that's a fair amount of data to look up. However, last night's episode was at 00:42 while the last full-sync was at 05:45. Full-sync is set to run every 12 hours.

31 Mar 2024, 12:42 PM
#222
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,876
Plugin Contributions:
7

Re: Instant Search

>more than 'max_user_connections' active connections

https://github.com/zencart/zencart/issues/1344

I also get this error occasionally. The raw access logs show a legitimate IP.
my max_user_connections is 25, set by the hosting.

I was until recently on a over-specified VPS, but I'd set this to 25 for a long time, as a test, with no occurrences, so reverted to shared hosting. Now I've had a couple of cases in the last two weeks.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

14 Jun 2024, 5:24 PM
#223
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,865
Plugin Contributions:
18

Re: Instant Search

Barebones 2.0.1 with PHP 8.2 but had the same problem elsewhere with other versions.
Latest Instant Search from Plugins 4.0.3
example at topkDOTjeandretDOTcom

Enter Phase3 in the search set for model-broad,category,manufacturer,name-description

With a max 12 for the dropdown, the dropdown is full as there are over twenty combinations

The dropdown display is fine UNTIL you click on search.

Then the system presents you with only four results and the first result in the Instant Search dropdown is number 4! :dontgetit

I need to have the result include all items that were found in the Instant Search and it appears that clicking on Search drops all results from model numbers.

I had this working on an older version of IS and 1.5.7c but it got munged in a migration.

I realize 2.0.1 now has deprecated the advanced_search files for search but I'm not seeing any simple setting in those files either. The search page includes/modules/pages/search/header.php does a lot in lines 16-25 but model id is not there. Model numbers are what most of the customers are searching for.

This is a must for this one store.

Suggestions or solutions greatfully appreciated.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

16 Jun 2024, 12:03 AM
#224
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,865
Plugin Contributions:
18

Re: Instant Search

I had to pull instant search out of the topkDOTjeandretDOTcom for other problems.

Still, on topkayakerDOTcom, entering n gets maximum results naturally. na gets the max again. nau still gets the max. naut starts narrowing the results and you'll note that after na, the top item has naturally been the Nautical Protractor.

Inputting nautical in any case results in the same two items with the Nautical Protractor on top clearly showing its products_mdel entry of CTR-255 (SR4)

BUT....

When you enter just c (upper or lower case) that corresponds with the first digit of the products_model entry, there is no mention of the Nautical Protractor.

What needs to be done to force instant search to find me the Nautical Protractor by products_model?!?

I am not sure which version of instant search is on this site. It's 1.5.7d with SBA, but I have tried all versions of Instant Search that are supposed to work with 1.5.7d on a test site. All have done the same thing.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

16 Jun 2024, 10:01 AM
#225
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,876
Plugin Contributions:
7

Re: Instant Search

Have a look at the branch I've just pushed:
https://github.com/torvista/zencart_instantsearch/tree/mods_POSM

When you compare with main, hopefully the comments are self-explanatory.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

15 Jan 2025, 10:31 PM
#226
nwce avatar

nwce

Zen Follower

Join Date:
Oct 2009
Posts:
444
Plugin Contributions:
0

Re: Instant Search

I am installing v.4.0.3 in on my local computer for upgrading my site to v.2.0.1...so it is a fresh install.

I have installed all of the files inside the Includes folder and placed the Instant Search folder (and all of its contents) directly into the zc_plugins folder in my site.

I log into Admin, go to Modules-> Plugin Manager and click on the Instant Search that I see there. I click on the Install button and I get a white screen.

The error log report shows:

[15-Jan-2025 22:22:32 UTC] PHP Fatal error: Declaration of ScriptedInstaller::doUpgrade(string $oldVersion = ''): bool must be compatible with Zencart\PluginSupport\ScriptedInstaller::doUpgrade($oldVersion): ?bool in C:\wamp64\www\new21\zc_plugins\InstantSearch\v4.0.3\Installer\ScriptedInstaller.php on line 27

I have obviously done something wrong....can you point me in the right direction as to what to do to fix this install??

Thanks,

Jeff

16 Jan 2025, 2:16 PM
#227
nwce avatar

nwce

Zen Follower

Join Date:
Oct 2009
Posts:
444
Plugin Contributions:
0

Re: Instant Search

In looking over the the error log this morning, the error appears to be because it is trying to "upgrade" instead of fresh install.

I have removed everything from line 27 down, till it gets to //Fresh install code. I then went to Admin->Modules->Plugins and Installed it, and it all installed fine!

When trying to use the Search in my sidebox to test this I receive the following in the error log:

  Request URI: /new21/, IP address: 127.0.0.1, Language id not set

#1 define() called at [C:\wamp64\www\new21\zc_plugins\InstantSearch\v4.0.3\catalog\includes\extra_datafiles\instant_search_filenames.php:10]
#2 require_once(C:\wamp64\www\new21\zc_plugins\InstantSearch\v4.0.3\catalog\includes\extra_datafiles\instant_search_filenames.php) called at [C:\wamp64\www\new21\includes\classes\FileSystem.php:24]
#3 Zencart\FileSystem\FileSystem->loadFilesFromDirectory() called at [C:\wamp64\www\new21\includes\classes\FileSystem.php:60]
#4 Zencart\FileSystem\FileSystem->loadFilesFromPluginsDirectory() called at [C:\wamp64\www\new21\includes\application_top.php:302]
#5 require(C:\wamp64\www\new21\includes\application_top.php) called at [C:\wamp64\www\new21\index.php:25]
--> PHP Warning: Constant FILENAME_INSTANT_SEARCH_RESULT already defined in C:\wamp64\www\new21\zc_plugins\InstantSearch\v4.0.3\catalog\includes\extra_datafiles\instant_search_filenames.php on line 10.

As well as a second error log of:

Request URI: /new21/admin/index.php?cmd=sqlpatch&action=execute, IP address: 127.0.0.1, Language id 1
#1 zen_check_config_key() called at [C:\wamp64\www\new21\admin\sqlpatch.php:164]
#2 executeSql() called at [C:\wamp64\www\new21\admin\sqlpatch.php:747]
#3 require(C:\wamp64\www\new21\admin\sqlpatch.php) called at [C:\wamp64\www\new21\admin\index.php:16]
--> PHP Warning: Undefined array key 1 in C:\wamp64\www\new21\admin\sqlpatch.php on line 675.

[16-Jan-2025 13:42:27 UTC] Request URI: /new21/admin/index.php?cmd=sqlpatch&action=execute, IP address: 127.0.0.1, Language id 1
#1 zen_check_config_key() called at [C:\wamp64\www\new21\admin\sqlpatch.php:164]
#2 executeSql() called at [C:\wamp64\www\new21\admin\sqlpatch.php:747]
#3 require(C:\wamp64\www\new21\admin\sqlpatch.php) called at [C:\wamp64\www\new21\admin\index.php:16]
--> PHP Warning: Undefined array key 3 in C:\wamp64\www\new21\admin\sqlpatch.php on line 676.

Would anyone be able to shed some light on these errors and how to fix them??

Thanks,

Jeff

20 Jan 2025, 4:48 PM
#228
nwce avatar

nwce

Zen Follower

Join Date:
Oct 2009
Posts:
444
Plugin Contributions:
0

Re: Instant Search

Since having issues with this plugin....I decided to install this plugin once again in a fresh version of ZC v.2.1 with a new database in my local computer. I then installed this plugin immediately before adding in my merged custom files or current store database.

It always throws the error as I have posted in post#226, so once again I removed this code. It still did not install correctly so I removed v.4 of this plugin, installed v.3.0.1 and then tried installing v.4 (following the instructions with certain file removals before install). I now was able to get it installed!

I configured the settings in Admin->Instant Search (as per my live site of ZC v1.5.8 and Instant Search v.3.0.1). When I go to this new development site and try using the Search to insure the Instant Search is working, I get the following error (and no Instant Search results are displayed):

PHP Fatal error: Uncaught Error: Class "Zencart\Plugins\Catalog\InstantSearch\InstantSearchLogger" not found in C:\wamp64\www\newsite\includes\classes\ajax\zcAjaxInstantSearch.php:60
Stack trace:
#0 C:\wamp64\www\newsite\ajax.php(71): zcAjaxInstantSearch->__construct()
#1 {main}
thrown in C:\wamp64\www\newsite\includes\classes\ajax\zcAjaxInstantSearch.php on line 60

It appears the error is related to logging the Search term I typed in, in the Search log which I had set to true in my settings in Admin->Instant Search I set this to false so that it does not log this, but still received the same error.

Could someone point me in the right direction to fix this??

Thanks.

21 Jan 2025, 7:55 AM
#229
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,876
Plugin Contributions:
7

Re: Instant Search

I have the latest Github version working with ZC210, php8.4 and using strict reporting. It requires multiple fixes.
I've uploaded it to this branch:
https://github.com/torvista/zencart_instantsearch/tree/torvista_fixes

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

21 Jan 2025, 12:54 PM
#230
nwce avatar

nwce

Zen Follower

Join Date:
Oct 2009
Posts:
444
Plugin Contributions:
0

Re: Instant Search

Thanks Torvista for your continued help with this plugin! I will head to Github for the latest version and give it a go.

21 Jan 2025, 1:35 PM
#231
nwce avatar

nwce

Zen Follower

Join Date:
Oct 2009
Posts:
444
Plugin Contributions:
0

Re: Instant Search

Good on you Torvista!

I downloaded it, insured that my entire previous version of 4.0.3 was deleted in all folders and uploaded your newest version.

When I tried installing it from Admin->Modules->Plugin Manager I still received the same error log with:

PHP Fatal error: Declaration of ScriptedInstaller::doUpgrade(string $oldVersion = ''): bool must be compatible with Zencart\PluginSupport\ScriptedInstaller::doUpgrade($oldVersion): ?bool in C:\wamp64\www\new21\zc_plugins\InstantSearch\v4.0.3\Installer\ScriptedInstaller. php on line 27

When I removed this entire code and tried installing now...it worked perfectly.

When I tried a Search on my localhost site, nothing happened....no error log and no instant search. I looked at my WAMP php version which was set to 8.0.3. I changed this to the next version of 8.1.28....still no luck....so I upped it once again to PhP version 8.2.18 and all works perfectly! Search dropdown is excellent...and when pressing Search it displays in the main column listing area...again no errors.

Thank you again for your continued help with this plugin. I will now progress on with the rest of my plugins and custom files...

31 Jan 2025, 4:19 PM
#232
nwce avatar

nwce

Zen Follower

Join Date:
Oct 2009
Posts:
444
Plugin Contributions:
0

Re: Instant Search

Hi Torvista....

In completing my development site with all of my addon plugins with only the demo data loaded into the database the plugin worked perfectly.

When I put my live site (Zen cart v.1.5.8) database into this development site and tested the plugin using the Search on the site, I received the following error:

PHP Fatal error: Uncaught Error: Undefined constant "INSTANT_SEARCH_MYSQL_USE_QUERY_EXPANSION" in C:\wamp64\www\new2121\includes\classes\ajax\zcAjaxInstantSearch.php:86
Stack trace:
#0 C:\wamp64\www\new2121\ajax.php(71): zcAjaxInstantSearch->__construct()
#1 {main}
thrown in C:\wamp64\www\new2121\includes\classes\ajax\zcAjaxInstantSearch.php on line 86

In my zc_plugins folder I have the newest v.4 plug installed and active and have done the Cleanup on the v.3 that was originally in there.

The Instant Search throws this error and on the site it does not perform the search.

Would you know what this would be?

31 Jan 2025, 9:58 PM
#233
nwce avatar

nwce

Zen Follower

Join Date:
Oct 2009
Posts:
444
Plugin Contributions:
0

Re: Instant Search

Hi Steve...

I went into the includes\classes\ajax\zcAjaxInstantSearch.php file and added the single quotes to the INSTANT_SEARCH_MYSQL_USE_QUERY_EXPANSION to eliminate this error....it then through another Undefined Constant error in this file on another line....etc. Kept defining the constants by adding in the single quotes and it eliminated this error.

The error that I am now trying to fix in this plugin is:

PHP Warning: Undefined array key "INSTANT_SEARCH_PRODUCT_FIELDS_LIST" in C:\wamp64\www\plugin21\zc_plugins\InstantSearch\v4.0.3\classes\SearchEngineProviders\MysqlSearchEngineProvider.php on line 133

Would you be able to suggest the code to define this array?

Thanks!

31 Jan 2025, 10:54 PM
#234
nwce avatar

nwce

Zen Follower

Join Date:
Oct 2009
Posts:
444
Plugin Contributions:
0

Re: Instant Search

To add to my last post...

There was a second error on the Debug log along with the one I posted in Post #233 above.

It is:

PHP Warning: foreach() argument must be of type array|object, null given in C:\wamp64\www\new2121\zc_plugins\InstantSearch\v4.0.3\classes\SearchEngineProviders\MysqlSearchEngineProvider.php on line 133

Hopefully this gives the full picture of what I'm experiencing.

Not sure why the plugin worked well in the stock Zen Cart v.2.1 with demo info in the database, and when I then added my Zen Cart v.1.5.8 database (ran the zc_install after to update the database to v.2.1) the plugin doesn't work and it throws this error. Adding the database was the only change I made....just for full disclosure.

One thought....when installing the plugin, does it happen to automatically run some sort of SQL statement that now needs to be rerun somehow to incorporate it into this database??

2 Feb 2025, 12:49 PM
#235
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,876
Plugin Contributions:
7

Re: Instant Search

After the import and running zc_install, in the admin plugin modules: does it shown instant search as installed?

Perhaps you should uninstall in zc158 before the initial export of the db.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

2 Feb 2025, 2:21 PM
#236
nwce avatar

nwce

Zen Follower

Join Date:
Oct 2009
Posts:
444
Plugin Contributions:
0

Re: Instant Search

Hi Steve....thanks for your reply!

When I imported my zen 1.5.8 database, the Instant Search showed in the plugins module but was uninstalled. I installed v.4 using the Upgrade button and then did the clean up on v.3

If I'm understanding your last suggestion about "uninstall in zc_158 before export of db".....you are meaning in my live cart??

When I imported this db into my development site....it doesn't show this old version as Installed.....neither of the versions were Installed when in Admin->Modules->PluginMgr

Not sure but errors in the Debug log that I am getting seem to be related to coding of the arrays...would this be a PhP or SQL version issue???

Thanks for your help with this....much appreciated!!

8 Feb 2025, 5:19 PM
#237
nwce avatar

nwce

Zen Follower

Join Date:
Oct 2009
Posts:
444
Plugin Contributions:
0

Re: Instant Search

Hi Steve,

I have been working on my site testing now that its on my server under a subfolder. I have got this plugin working perfectly now!

What I have done to mitigate my problems from my previous posts is when I place in my live site database, I completely uninstalled the plug in removing all plugin files inside the Included folder and the entire zc_plugins folder files.

I signed into my Admin panel to insure it was removed.

I then reinstalled the plugin files, signed into Admin and Installed the plugin through Admin->Modules->Plugin Mgr. When pressing the Install I got the Admin white screen and had to alter the zc_plugins\InstantSearch\v4.0.3\Installer\ScriptedInstaller. php on line 27 by removing the entire coding.

I then ran the Install in Admin->Plugin Mgr and had success installing.

Went to my site, refreshed it, and tried searching....and presto....works perfectly! No errors in Debug Logs.

Wanted to update you....and if someone else has these problems or errors...

9 Feb 2025, 12:27 PM
#238
nwce avatar

nwce

Zen Follower

Join Date:
Oct 2009
Posts:
444
Plugin Contributions:
0

Re: Instant Search

After having this plugin working perfectly in my test site on my server....I ran the Database Converter Plugin....and it broke the Instant Search plugin where it threw an error in the Debug Log and it simply no longer Searched when testing on the site.

I tried uninstalling the plugin via removing all files (thinking that this worked when I dropped in my live site DB)....checking in Admin panel->Plugin Mgr to insure that it was removed and then reinstalling the files.

Now when going to Admin->Modules->Plugin Mgr, I see the plugin and when pressing Install I receive the error at the top of my Admin page of:

Duplicate key name 'idx_products_name'
Duplicate key name 'idx_products_description'

The plugin will not install.

Hoping this helps to decipher what took place when using the database converter tool...and how to fix it?

I had posted about this in the Database Converter plugin thread...and lat9 suggested I post in in here.

Thanks for your help!

9 Feb 2025, 9:00 PM
#239
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,973
Plugin Contributions:
8

Re: Instant Search

NWCE:

After having this plugin working perfectly in my test site on my server....I ran the Database Converter Plugin....and it broke the Instant Search plugin where it threw an error in the Debug Log and it simply no longer Searched when testing on the site.

I tried uninstalling the plugin via removing all files (thinking that this worked when I dropped in my live site DB)....checking in Admin panel->Plugin Mgr to insure that it was removed and then reinstalling the files.

Now when going to Admin->Modules->Plugin Mgr, I see the plugin and when pressing Install I receive the error at the top of my Admin page of:

Duplicate key name 'idx_products_name'
Duplicate key name 'idx_products_description'

The plugin will not install.

Hoping this helps to decipher what took place when using the database converter tool...and how to fix it?

I had posted about this in the Database Converter plugin thread...and lat9 suggested I post in in here.

Thanks for your help!

do you have log files?

what version of this plugin are you running?

i would compare this file:

https://github.com/marco-pm/zencart_instantsearch/blob/main/zc_plugins/InstantSearch/v4.0.3/Installer/ScriptedInstaller.php

with the one on your site.

it does seem that the scriptedInstaller checks for that index PRIOR to creating a new one with the same name. as to whether that code works, i can not say. but log files would help.

best.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

9 Feb 2025, 10:37 PM
#240
nwce avatar

nwce

Zen Follower

Join Date:
Oct 2009
Posts:
444
Plugin Contributions:
0

Re: Instant Search

Thanks for chiming in on this carlwhat!

I am running the latest version that Torvista updated not long ago (post#229)

When I get this error in my Admin panel

Duplicate key name 'idx_products_name'
Duplicate key name 'idx_products_description'

There are no Debug Logs that it throws....it simply does not install and displays these 2 errors in red at the top of the Admin screen.

Is it possible that these are database tables that are duplicates? Is there a way to Search the DB for this and possibly delete too mitigate this error?

Thanks again