Productsearch - Stored procedure does not find products with searchterm like "8,5"

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
Hello,

I have a product with text (product name) like: "BÄR® treskrue, senkhode, T-Drive (Torx), delgjenget, gulkromatisert, 3,0 - 6,0".

- Searching now for "Treskrue" finds this product.
- searching for "bär treskrue delgjenget" finds this product as well, since I have configured FullTextSearch with AND-parameter

BUT searching for "treskrue 6,0" does not find anything, but "6,0" is part of name and textpart of product description.

I do have other products containing "6,0" as well, searching only "6,0" should give a result, but does not find anything.

I did run the storedProcedure for productSearch directly in SSMS to check, with same result. So this must be something in the storedprocedure, or in the settings for the SQL Server Express 2016 or the database itself (which is 2014 compatible).
I hope some can help me, since that ara quite often used search terms in my shop.

Thanks a lot in advance !
5 years ago
We have the same (or similar) issue. We use NopCommerce 3.9.

If a search term is entered which no product name starts with, but some product names contain, the stored procedure will sometimes find the products and sometimes not. The behavior is not completely erratic, the same searchterm will either always deliver all applicable products or never deliver any, but otherwise there is no discernible pattern.

For example, i have two product names ending in "Serie CG2420" and "Serie CS2420"
Searching for "2420" will return "no results found", just as will "G242" or "S242".
But searching for "CG24" or "CS24" will always return the respective product.

The thing is, i tried disabling using the stored procedure for all product searches (by code, not in admin settings), and with the LINQ query all product searches work as intended.

So the bug must be either in the stored procedure itself or in the "use stored procedure" branch of the method ProductSearch within the ProductService class. (90% sure it's in the stored procedure.)
But I checked both the code of the method and of the stored procedure and cannot find the bug.

So currently I will leave it at "always use LINQ" but it's not a satisfying solution. So, does anyone here have a clue about how to find and remove the bug so we can use the stored procedure again?
5 years ago
You can try debugging the stored procedure - ProductLoadAllPaged

I recommend starting by looking at the sql that is generated

  --PRINT (@sql)
  EXEC sp_executesql @sql, N'@Keywords nvarchar(4000), @OriginalKeywords nvarchar(4000)', @Keywords, @OriginalKeywords


- find the WHERE clause that is causing the issue and then work backwards to find the code that generates that WHERE clause.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.