Search in the product description

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
2 years ago
I don't recall if the optional parameters are always set by the calling code.  If you want to force the search to always search descriptions, then 'ignore' the input parameter by overriding it;  enter this statement at the top of the stored procedure body

SET @SearchDescriptions = 1;
2 years ago
BINGO!  That did it.  

Evidently, the nopCommerce code must explicitly pass a zero in for that parameter, thus defeating the default setting in the stored procedure.   Explicitly setting it to 1 at the top of the SP is the way around this.  

Thank you so much for your help on this.
1 year ago
nopCommerce version: 4.50.3 without source x64. MS SQL 2019

How to turn on search in the Product Description always should be on by default?

There are no any Views/Queries/StoredProcedures inside db, only Tables.
Please advice, thank you!
1 year ago
1CLICK.LV wrote:
nopCommerce version: 4.50.3 without source x64. MS SQL 2019
How to turn on search in the Product Description always should be on by default?
There are no any Views/Queries/StoredProcedures inside db, only Tables.

there are no such settings. the default value is false at the backend code. you can only enabled this from advance search setting. you need to customize the code for your desired settings.
public virtual async Task<IPagedList<Product>> SearchProductsAsync(
            int pageIndex = 0,
            int pageSize = int.MaxValue,
            IList<int> categoryIds = null,
            IList<int> manufacturerIds = null,
            int storeId = 0,
            int vendorId = 0,
            int warehouseId = 0,
            ProductType? productType = null,
            bool visibleIndividuallyOnly = false,
            bool excludeFeaturedProducts = false,
            decimal? priceMin = null,
            decimal? priceMax = null,
            int productTagId = 0,
            string keywords = null,
            bool searchDescriptions = false,
            bool searchManufacturerPartNumber = true,
            bool searchSku = true,
            bool searchProductTags = false,
            int languageId = 0,
            IList<SpecificationAttributeOption> filteredSpecOptions = null,
            ProductSortingEnum orderBy = ProductSortingEnum.Position,
            bool showHidden = false,
            bool? overridePublished = null)
        {

1 year ago
Rashed Khan wrote:
there are no such settings


You should consider to have it in version 4. This topic has been asked at least three times in past 10 years.
No, we are not going to modify your source code, this is not way to go for us, because this option make a bottle neck for updates delivered via CI/CD .
1 year ago
[quote=Rashed Khan]need to customize the code for your desired settings{[/code]

\nopCommerce_4.50.2_Source\src\Libraries\Nop.Services\Catalog\IProductService.cs

169c169
<             bool searchDescriptions = true,
---
>             bool searchDescriptions = false,
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.