News:

Support the VirtueMart project and become a member

Main Menu

Different search problems

Started by Milbo, November 01, 2023, 10:22:59 AM

Previous topic - Next topic

Milbo

here a nice example, why members should use the forum first and if they dont get a solution here, then write a ticket.
First member:
"I installed the new member version and all products created after this period are not displayed at search results"

My answer:
"From my point of view, this is impossible.
But maybe something else changed. For example you try to find children without category, but products without category are not shown up? maybe something like that is more likely"

Next member:
"When searching for products in the frontend the search result is often empty even if there is a lot of products it should have found. Its the same if I search after product_sku or after word in the product_name"
"When searching from the backend everything is good"

My answer:
"You could use the sql debug mode in virtuemart to see the executed sql"

It looks like both customers have the same problem and maybe others also. Maybe others solved it already. Maybe the problem comes from a shared session?
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

Please enable debugging for administrators, enable debugging sql,.. do the search and post here your sql, then we can see the executed sql and either find the error there or exclude it, thank you.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

cvrak

I've enable debugging and sql debugging in Vm.
I did the search and these are the results:

FRONTEND
Deprecated: Joomla\Input\Input implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /var/www/vhosts/spacetravels.gr/site47_dentalpin/libraries/vendor/joomla/input/src/Input.php on line 41

Deprecated: Return type of Joomla\Input\Input::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/spacetravels.gr/site47_dentalpin/libraries/vendor/joomla/input/src/Input.php on line 170

Deprecated: Joomla\CMS\Input\Input implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /var/www/vhosts/spacetravels.gr/site47_dentalpin/libraries/src/Input/Input.php on line 31

Deprecated: Joomla\CMS\Input\Cookie implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /var/www/vhosts/spacetravels.gr/site47_dentalpin/libraries/src/Input/Cookie.php on line 0

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/spacetravels.gr/site47_dentalpin/libraries/src/Uri/Uri.php on line 141

Notice: Accessing static property VmImage::$theme_url as non static in /var/www/vhosts/spacetravels.gr/site47_dentalpin/plugins/system/vmogmetatag/vmogmetatag.php on line 145

Warning: Undefined property: VmImage::$theme_url in /var/www/vhosts/spacetravels.gr/site47_dentalpin/plugins/system/vmogmetatag/vmogmetatag.php on line 145


BACKEND
Deprecated: Joomla\Input\Input implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /var/www/vhosts/spacetravels.gr/site47_dentalpin/libraries/vendor/joomla/input/src/Input.php on line 41

Deprecated: Return type of Joomla\Input\Input::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/spacetravels.gr/site47_dentalpin/libraries/vendor/joomla/input/src/Input.php on line 170

Deprecated: Joomla\CMS\Input\Input implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /var/www/vhosts/spacetravels.gr/site47_dentalpin/libraries/src/Input/Input.php on line 31

Deprecated: Joomla\CMS\Input\Cookie implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /var/www/vhosts/spacetravels.gr/site47_dentalpin/libraries/src/Input/Cookie.php on line 0

Deprecated: Joomla\Input\Input implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /var/www/vhosts/spacetravels.gr/site47_dentalpin/libraries/vendor/joomla/input/src/Input.php on line 41

Deprecated: Return type of Joomla\Input\Input::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/spacetravels.gr/site47_dentalpin/libraries/vendor/joomla/input/src/Input.php on line 170

Deprecated: Joomla\CMS\Input\Input implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /var/www/vhosts/spacetravels.gr/site47_dentalpin/libraries/src/Input/Input.php on line 31

Deprecated: Joomla\CMS\Input\Cookie implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /var/www/vhosts/spacetravels.gr/site47_dentalpin/libraries/src/Input/Cookie.php on line 0

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/spacetravels.gr/site47_dentalpin/libraries/src/Uri/Uri.php on line 141

The URL of the site is www.dentalpin.gr if you can check what the error is

Thanks

cvrak

I believe the SQL debugging is:



1 vmdebug Show All Errors, PHP-Version 8.1.25

2 vmdebug 2 Languages, default joomla language $jDefLang): el_gr el-GR
Fallback language (VmConfig::$defaultLang): en_gb en-GB
Selected VM language (VmConfig::$vmlang): el_gr el-GR SEF: $lfbs =

3 vmdebug 2 Languages, default joomla language $jDefLang): el_gr el-GR
Fallback language (VmConfig::$defaultLang): en_gb en-GB
Selected VM language (VmConfig::$vmlang): el_gr el-GR SEF: $lfbs =

4 vmdebug isManagingFE result by session/GET for view 0 Var0:

0

5 vmdebug vmTime: time to load config param $lang=1 and iniLang=0 $exeTrig = 1 now = 0: 0.0102689266204834

6 vmdebug Start used Ram 8M

7 vmdebug FE main controller with controller category and task

8 vmdebug isManagingFE result by session/GET for view category Var0:

0

9 vmdebug VmView loaded with override

10 vmdebug isFEmanager return false because user is guest

11 vmdebug My Memory Limit in MB 507

12 vmdebug 2 Languages, default joomla language $jDefLang): el_gr el-GR
Fallback language (VmConfig::$defaultLang): en_gb en-GB
Selected VM language (VmConfig::$vmlang): el_gr el-GR SEF: $lfbs =

12 vmTrace sortSearchListQuery

#0 /var/www/vhosts/spacetravels.gr/site47_dentalpin/administrator/components/com_virtuemart/models/product.php(338): vmTrace()
#1 /var/www/vhosts/spacetravels.gr/site47_dentalpin/components/com_virtuemart/views/category/view.html.php(283): VirtueMartModelProduct->sortSearchListQuery()
#2 /var/www/vhosts/spacetravels.gr/site47_dentalpin/components/com_virtuemart/controllers/category.php(61): VirtuemartViewCategory->display()

13 vmdebug getChildCategoryListObject Var0:

SELECT  c.category_parent_id, c.`ordering`, c.virtuemart_category_id, c.virtuemart_vendor_id, c.category_template, c.category_layout, c.category_product_layout, c.products_per_row, c.limit_list_step, c.limit_list_initial, c.hits, c.cat_params, c.metarobot, c.metaauthor, c.shared, c.`published`, c.has_children, c.has_medias, IFNULL(l.category_name,ld.category_name) as category_name, IFNULL(l.category_description,ld.category_description) as category_description, IFNULL(l.metadesc,ld.metadesc) as metadesc, IFNULL(l.metakey,ld.metakey) as metakey, IFNULL(l.customtitle,ld.customtitle) as customtitle, IFNULL(l.slug,ld.slug) as slug  FROM #__virtuemart_categories as c  LEFT JOIN `#__virtuemart_categories_en_gb` as ld ON ld.`virtuemart_category_id` = c.`virtuemart_category_id`  LEFT JOIN `#__virtuemart_categories_el_gr` as l ON l.`virtuemart_category_id` = c.`virtuemart_category_id`  WHERE  (c.`category_parent_id` = 82) AND  c.`published` = 1  ORDER BY c.ordering,category_name ASC

14 vmdebug vmTime: getChildCategoryListObject summed up 1_82_c.ordering,category_name1ASC0__0el-GR0: 0.00229001045227051

15 vmdebug Get user, using given id 0

16 vmdebug Get user id 0

17 vmdebug exeSortSearchListQuery my $limitStart 0 $limit 48 q Var0:

SELECT SQL_CALC_FOUND_ROWS  p.`virtuemart_product_id`, IFNULL(l.product_name,ld.product_name) as product_name
      FROM `jos_virtuemart_products` as p   
LEFT JOIN `jos_virtuemart_products_en_gb` as ld ON ld.`virtuemart_product_id` = p.`virtuemart_product_id`
LEFT JOIN `jos_virtuemart_products_el_gr` as l ON l.`virtuemart_product_id` = p.`virtuemart_product_id`
LEFT JOIN `jos_virtuemart_product_shoppergroups` as ps ON p.`virtuemart_product_id` = `ps`.`virtuemart_product_id` 
LEFT JOIN `jos_virtuemart_product_categories` as pc ON p.`virtuemart_product_id` = `pc`.`virtuemart_product_id` 
LEFT JOIN `jos_virtuemart_categories` as c ON c.`virtuemart_category_id` = `pc`.`virtuemart_category_id`
WHERE ( `pc`.`virtuemart_category_id` IN (82)  AND  `c`.`published` = 1  AND  ( `ps`.`virtuemart_shoppergroup_id`= "1"  OR `ps`.`virtuemart_shoppergroup_id` IS NULL  )  AND  p.`published`="1" )
group by p.`virtuemart_product_id`
ORDER BY `pc`.`ordering` ASC, `product_name` ASC

18 vmdebug exeSortSearchListQuery result Var0:

Array
(
   
  • => 716
        [1] => 718
        [2] => 715
        [3] => 722
        [4] => 727
        [5] => 724
        [6] => 725
        [7] => 740
        [8] => 743
        [9] => 737
        [10] => 726
        [11] => 738
        [12] => 739
        [13] => 748
        [14] => 752
        [15] => 753
        [16] => 723
        [17] => 747
        [18] => 749
        [19] => 750
        [20] => 751
        [21] => 741
        [22] => 728
        [23] => 734
        [24] => 733
        [25] => 731
        [26] => 732
        [27] => 736
        [28] => 735
        [29] => 729
        [30] => 730
        [31] => 742
        [32] => 745
        [33] => 744
        [34] => 746
        [35] => 1
        [36] => 463
        [37] => 489
        [38] => 490
        [39] => 488
        [40] => 476
        [41] => 341
        [42] => 664
    )

    19 vmdebug vmTime: sortSearchQuery products: : 0.00475907325744629

    20 vmdebug vmTime: Manufacturers Dropdown by Cache: 0.0124058723449707

    21 vmdebug vmTime: OrderByList by function: 0.00105190277099609

    22 vmdebug SSL enabled

    23 vmdebug isSuperVendor Not a vendor 0 0

    24 vmdebug Fallback active

    25 vmdebug Refallback

    26 vmdebug storing router $_catRoute cache

    27 vmdebug End used Ram 20M

    28 vmdebug Peak memory peak 20M

    29 vmdebug vmTime: "VirtuemartControllerCategory" Finished task in /var/www/vhosts/spacetravels.gr/site47_dentalpin/components/com_virtuemart: 0.645875930786133

Multisilja

I have researched a bit.
In my case it only searches in the active category open in the front end. There it finds products ok.
But it can't find anything if the product is not in the active category.

If I change the active category it only find producte from this.
I'm using the Virtuemart Category Module.

The problem has only occured after a restore of the entire site from an akeeba backup.

It seems that the setting 'Search Filter Category' in the 'VirtueMart Search Product' module has no effect.
Have tried both yes and no.
(Wondering if there is another setting I have missed.)

I'm also considering to make an 'all products category' to hold all the products. But I find that a little odd.

Milbo

Quote from: cvrak on November 01, 2023, 11:29:55 AM
I believe the SQL debugging is:

.....

17 vmdebug exeSortSearchListQuery my $limitStart 0 $limit 48 q Var0:

SELECT SQL_CALC_FOUND_ROWS  p.`virtuemart_product_id`, IFNULL(l.product_name,ld.product_name) as product_name
      FROM `jos_virtuemart_products` as p   
LEFT JOIN `jos_virtuemart_products_en_gb` as ld ON ld.`virtuemart_product_id` = p.`virtuemart_product_id`
LEFT JOIN `jos_virtuemart_products_el_gr` as l ON l.`virtuemart_product_id` = p.`virtuemart_product_id`
LEFT JOIN `jos_virtuemart_product_shoppergroups` as ps ON p.`virtuemart_product_id` = `ps`.`virtuemart_product_id` 
LEFT JOIN `jos_virtuemart_product_categories` as pc ON p.`virtuemart_product_id` = `pc`.`virtuemart_product_id` 
LEFT JOIN `jos_virtuemart_categories` as c ON c.`virtuemart_category_id` = `pc`.`virtuemart_category_id`
WHERE ( `pc`.`virtuemart_category_id` IN (82)  AND  `c`.`published` = 1  AND  ( `ps`.`virtuemart_shoppergroup_id`= "1"  OR `ps`.`virtuemart_shoppergroup_id` IS NULL  )  AND  p.`published`="1" )
group by p.`virtuemart_product_id`
ORDER BY `pc`.`ordering` ASC, `product_name` ASC

This is what we are looking for. But there is no search. We need this, but with search.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Multisilja

I hope this is the SQL debugging:

SELECT SQL_CALC_FOUND_ROWS  p.`virtuemart_product_id`, l.product_name, l.product_s_desc, l.product_desc
      FROM `ryomvirtuemart_products` as p   
LEFT JOIN `ryomvirtuemart_products_da_dk` as l ON l.`virtuemart_product_id` = p.`virtuemart_product_id`
LEFT JOIN `ryomvirtuemart_product_shoppergroups` as ps ON p.`virtuemart_product_id` = `ps`.`virtuemart_product_id` 
LEFT JOIN `ryomvirtuemart_product_categories` as pc ON p.`virtuemart_product_id` = `pc`.`virtuemart_product_id` 
LEFT JOIN `ryomvirtuemart_categories` as c ON c.`virtuemart_category_id` = `pc`.`virtuemart_category_id`
WHERE ((l.`product_name` LIKE "%228-970%" OR `p`.product_sku LIKE "%228-970%" OR l.`product_s_desc` LIKE "%228-970%" OR l.`product_desc` LIKE "%228-970%" OR `p`.product_gtin LIKE "%228-970%") AND  `pc`.`virtuemart_category_id` IN (273)  AND  `c`.`published` = 1  AND  ( `ps`.`virtuemart_shoppergroup_id`= "2"  OR `ps`.`virtuemart_shoppergroup_id` IS NULL  )  AND  p.`published`="1" )
group by p.`virtuemart_product_id`
ORDER BY `p`.product_sku ASC, p.`virtuemart_product_id` ASC LIMIT 24

Milbo

Quote from: Multisilja on November 02, 2023, 12:46:54 PM
I hope this is the SQL debugging:

SELECT SQL_CALC_FOUND_ROWS  p.`virtuemart_product_id`, l.product_name, l.product_s_desc, l.product_desc
      FROM `ryomvirtuemart_products` as p   
LEFT JOIN `ryomvirtuemart_products_da_dk` as l ON l.`virtuemart_product_id` = p.`virtuemart_product_id`
LEFT JOIN `ryomvirtuemart_product_shoppergroups` as ps ON p.`virtuemart_product_id` = `ps`.`virtuemart_product_id` 
LEFT JOIN `ryomvirtuemart_product_categories` as pc ON p.`virtuemart_product_id` = `pc`.`virtuemart_product_id` 
LEFT JOIN `ryomvirtuemart_categories` as c ON c.`virtuemart_category_id` = `pc`.`virtuemart_category_id`
WHERE ((l.`product_name` LIKE "%228-970%" OR `p`.product_sku LIKE "%228-970%" OR l.`product_s_desc` LIKE "%228-970%" OR l.`product_desc` LIKE "%228-970%" OR `p`.product_gtin LIKE "%228-970%") AND  `pc`.`virtuemart_category_id` IN (273)  AND  `c`.`published` = 1  AND  ( `ps`.`virtuemart_shoppergroup_id`= "2"  OR `ps`.`virtuemart_shoppergroup_id` IS NULL  )  AND  p.`published`="1" )
group by p.`virtuemart_product_id`
ORDER BY `p`.product_sku ASC, p.`virtuemart_product_id` ASC LIMIT 24

Looks good. What you can see here, is that it takes only products with assigned category  `pc`.`virtuemart_category_id` IN (273)  . You can change this in the vmconfig, tab Shop.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

cvrak

This is the SQL debugging after search. I searched for products "estelite"

17 vmdebug exeSortSearchListQuery my $limitStart 0 $limit 48 q Var0:

SELECT SQL_CALC_FOUND_ROWS  p.`virtuemart_product_id`, IFNULL(l.product_name,ld.product_name) as product_name, IFNULL(l.product_s_desc,ld.product_s_desc) as product_s_desc, IFNULL(l.product_desc,ld.product_desc) as product_desc
      FROM `jos_virtuemart_products` as p   
LEFT JOIN `jos_virtuemart_products_en_gb` as ld ON ld.`virtuemart_product_id` = p.`virtuemart_product_id`
LEFT JOIN `jos_virtuemart_products_el_gr` as l ON l.`virtuemart_product_id` = p.`virtuemart_product_id`
LEFT JOIN `jos_virtuemart_product_shoppergroups` as ps ON p.`virtuemart_product_id` = `ps`.`virtuemart_product_id` 
LEFT JOIN `jos_virtuemart_product_categories` as pc ON p.`virtuemart_product_id` = `pc`.`virtuemart_product_id` 
LEFT JOIN `jos_virtuemart_categories` as c ON c.`virtuemart_category_id` = `pc`.`virtuemart_category_id`
WHERE ((l.`product_name` LIKE "%estelite%" OR ld.`product_name` LIKE "%estelite%" OR l.`product_s_desc` LIKE "%estelite%" OR ld.`product_s_desc` LIKE "%estelite%" OR l.`product_desc` LIKE "%estelite%" OR ld.`product_desc` LIKE "%estelite%") AND  `pc`.`virtuemart_category_id` IN (82)  AND  `c`.`published` = 1  AND  ( `ps`.`virtuemart_shoppergroup_id`= "1"  OR `ps`.`virtuemart_shoppergroup_id` IS NULL  )  AND  p.`published`="1" )
group by p.`virtuemart_product_id`
ORDER BY `pc`.`ordering` ASC, `product_name` ASC

Multisilja

QuoteLooks good. What you can see here, is that it takes only products with assigned category  `pc`.`virtuemart_category_id` IN (273)  . You can change this in the vmconfig, tab Shop.

I'm sorry but I can't find that setting under the 'Shop' Tab in the Configuration.

Milbo

Vm Config, Tab "Shopfront", chapter "Product Listing", option "Show uncategorised child products in search results and modules"
Enable it.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

cvrak

Quote from: Milbo on November 09, 2023, 20:06:27 PM
Vm Config, Tab "Shopfront", chapter "Product Listing", option "Show uncategorised child products in search results and modules"
Enable it.

I've set as Milbo suggests but the problem remains.
After many testd i've noticed that after Search the "recommended products" page is displayed without results. Ok, this is normal since the searched product is not Recommended. If I add this category in the products it is shown. So I believe its some problem with search module.
Any suggestions?
Thanks

Milbo

Please repost your new search query, with the option enabled
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Multisilja

QuoteVm Config, Tab "Shopfront", chapter "Product Listing", option "Show uncategorised child products in search results and modules"
Enable it.

The setting suggested by Milbo didn't help me either. But I'm not using child products. Perhaps thats why.

But I have set the 'Show Search' option in all my Product Categories to No. That helped.

And I have setup the 'Virtuemart Search Product' Module in my header. But I can live with that. At least it now finds what it is supposed to. :)

cvrak

Quote from: Milbo on November 10, 2023, 17:40:22 PM
Please repost your new search query, with the option enabled

This is the SQL debugging, searching for the product "estelite"

17 vmdebug exeSortSearchListQuery my $limitStart 0 $limit 48 q Var0:

SELECT SQL_CALC_FOUND_ROWS  p.`virtuemart_product_id`, l.product_name, l.product_s_desc, l.product_desc
      FROM `jos_virtuemart_products` as p   
LEFT JOIN `jos_virtuemart_products_en_gb` as l ON l.`virtuemart_product_id` = p.`virtuemart_product_id`
LEFT JOIN `jos_virtuemart_product_shoppergroups` as ps ON p.`virtuemart_product_id` = `ps`.`virtuemart_product_id` 
LEFT JOIN `jos_virtuemart_product_categories` as pc ON p.`virtuemart_product_id` = `pc`.`virtuemart_product_id`
WHERE ((l.`product_name` LIKE "%estelite%" OR l.`product_s_desc` LIKE "%estelite%" OR l.`product_desc` LIKE "%estelite%") AND  `pc`.`virtuemart_category_id` IN (82)  AND  ( `ps`.`virtuemart_shoppergroup_id`= "1"  OR `ps`.`virtuemart_shoppergroup_id` IS NULL  )  AND  p.`published`="1" )
group by p.`virtuemart_product_id`
ORDER BY `pc`.`ordering` ASC, `product_name` ASC