Extending Advance Search Functionality

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

Have anyone tried to extend the Advance search facility, which currently offers manufacture/category filtering. I was looking for flexibility in advance search as I want to include a field size in the dropdownlist , so that the client can search the products within that size range. By modifying the stored procedure(ProductLoadAllPaged) adding: patindex(@Keywords, p.size) > 0 actually find the products within that size , but i was looking for an extra dropdown list with sizes , so the text entered in the keywords should actually look into the column which has similar size and returns the product of that size , hope it make sense , Note: the size of product are fixed like 20 , 30 , 50 , 60 ... 100.
If anyone can provide some assistance or just guide me as to what modification should be done achieve it , I was going through the search method which looks quite complicated to me as it is being used by almost all the actions , so i don't want to take any risk modifying it.

Also Currently search functionality is not working as it should or may be I am doing something wrong, for instance
Scenario

Category 1
  product1
  product2

Category 2
Subcategory 2.1
     Product 2.2.1
      Product 2.2.2

........

I selected Category2>Subcategory 2.1 & then searched Product 2.2.1 which shows the product but when I select Category1 & searched for the same product( Product 2.2.1) which in results shows that product but in general it should not search that product, as the product is not in that category.
12 years ago
creative3k wrote:

Also Currently search functionality is not working as it should or may be I am doing something wrong, for instance
Scenario

Category 1
  product1
  product2

Category 2
Subcategory 2.1
     Product 2.2.1
      Product 2.2.2

........

I selected Category2>Subcategory 2.1 & then searched Product 2.2.1 which shows the product but when I select Category1 & searched for the same product( Product 2.2.1) which in results shows that product but in general it should not search that product, as the product is not in that category.


I sorted out the above issue as i am not using the advance search checkbox, i have to do some minor changes in CatalogController.cs in the search method , need to make sure that  model.As = true & searchInDescriptions = true is set to true, now it works fine .

Also regarding adding one more dropdownlist for search , I have to separate the search method from the original searchmethod used to search all the methods. I duplicated Search method in the CatalogController.cs with some changes :
I added following code in the new search method:
var productsNewSearch = _productService.GetAllProducts();
            if (productsNewSearch .Count > 0)
            {
                model.idproduct.Add(new SelectListItem()
                {
                    Value = "0",
                    Text = _localizationService.GetResource("Common.All")
                });
                foreach (var m in productsNewSearch )
                    model.idproduct.Add(new SelectListItem()
                    {
                        Value = m.Id.ToString(),
                        Text = m.Size,// I want the dropdown list to show size, one can use any field from the products table
                        Selected = model.Pid == m.Id
                        
                    });

Similarly the view should be modified to display the dropdownlist populated with size.
Also modify the stored procedure , IProductService.cs , ProductService.cs and SearchModel
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.