How can i remove minimum length functionality in search

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
borrierulez wrote:
Ok, tx already for the answers, I'm getting really close now.

I removed if (Request.Params["Q"] != null) from catalogcontroller.cs i set the minimumlenght of the keyword to 0

Now when I go to advanced search, I remove the keyword text, select the manufacturer, select the category and the search works perfectly!!! HURRAY!! :)

Now the next step would be to get to the advanced search immidiatly and remove the keyword box (because i just want to get results from the 2 dropdownboxes and not by keyword)

Do you know how to do that? From the moment i remove the advanced searchbox option and do a search I get ALL results in stead of the selected dropdownboxes...


You can edit the stored procedure [dbo].[ProductLoadAllPaged]  for that , have a look at :
  AND  (
        @SearchKeywords = 0 or
        (
          -- search standard content
          patindex(@Keywords, p.name) > 0
          or patindex(@Keywords, p.size) > 0
          or patindex(@Keywords, pv.name) > 0
          or patindex(@Keywords, pv.sku) > 0
        --  or patindex(@Keywords, isnull(sao.name, '')) > 0
          --or (@SearchDescriptions = 1 and patindex(@Keywords, p.ShortDescription) > 0)
          or (@SearchDescriptions = 1 and patindex(@Keywords, p.FullDescription) > 0)
          or (@SearchDescriptions = 1 and patindex(@Keywords, pv.Description) > 0)          
          --searching of the localized values
          --comment the lines below if you don't use it. It'll improve the performance
          --or (lp.LocaleKey = N'Name' and patindex(@Keywords, lp.LocaleValue) > 0)
          --or (@SearchDescriptions = 1 and lp.LocaleKey = N'ShortDescription' and patindex(@Keywords, lp.LocaleValue) > 0)
          --or (@SearchDescriptions = 1 and lp.LocaleKey = N'FullDescription' and patindex(@Keywords, lp.LocaleValue) > 0)
        )
      )
And comment out , depending on ur requirements
12 years ago
Creative3k,

Tx for your answer, the search function works how it should (if i leave the keyword blank) Do you know how i could remove the keyword field and get the advanced search function by default?

Borrie
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.