Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 5 of 5

Thread: Basic Search: searching in Description

  1. #1
    kaezr is offline Member
    Join Date
    May 2009
    Posts
    40

    Default Basic Search: searching in Description

    I'd like the basic search to look also in the Product Description,
    so i'm modifying the aspdnsf_GetProducts this way:

    Code:
    if exists (select * from [dbo].sysobjects where id = OBJECT_ID(N'[dbo].[aspdnsf_GetProducts]') and OBJECTPROPERTY(id,N'IsProcedure') = 1)
        DROP PROCEDURE [dbo].[aspdnsf_GetProducts]
    GO
    create proc [dbo].[aspdnsf_GetProducts]
        @categoryID      int = null,  
        @sectionID       int = null,  
        @manufacturerID  int = null,  
        @distributorID   int = null,  
        @genreID         int = null,  
        @vectorID        int = null,  
        @localeID        int = null,  
        @CustomerLevelID int = null,  
        @affiliateID     int = null,  
        @ProductTypeID   int = null,  
        @ViewType        bit = 1, -- 0 = all variants, 1 = one variant  
        @sortEntity      int = 0, -- 1 = category, 2 = section, 3 = manufacturer, 4 = distributor, 5= genre, 6 = vector  
        @pagenum         int = 1,  
        @pagesize        int = null,  
        @StatsFirst      tinyint = 1,  
        @searchstr       nvarchar(4000) = null,  
        @extSearch       tinyint = 1,
    so the next line will be true

    Code:
    or (patindex(@searchstr, isnull(p.Description, '')) > 0 and @extSearch = 1)
    is this the right way?

    thanks
    Running AspDotNetStorefront ML 8.0.1.4

  2. #2
    kaezr is offline Member
    Join Date
    May 2009
    Posts
    40

    Default

    It seems to work...
    Waiting to know if it was the correct way...

    It would be nice to have tags for the products,
    because i think that serching in the description brings the problem that you call "Noise Words" here http://manual.aspdotnetstorefront.co...xt-search.aspx
    Running AspDotNetStorefront ML 8.0.1.4

  3. #3
    Sennaya is offline Member
    Join Date
    Dec 2008
    Location
    http://www.ecscase.com
    Posts
    91

    Default

    The easist way is to use the advanced search, searchadv.aspx and there is a radio button for descriptions yes or no.
    You can edit the associated page.searchadv.xml.config file to remove unwanted search parameters.
    Hope that is useful!

  4. #4
    kaezr is offline Member
    Join Date
    May 2009
    Posts
    40

    Default

    Quote Originally Posted by Sennaya View Post
    The easist way is to use the advanced search, searchadv.aspx and there is a radio button for descriptions yes or no.
    You can edit the associated page.searchadv.xml.config file to remove unwanted search parameters.
    Hope that is useful!
    Yeah, I know, but I think that most of the customers will use the quick search..
    Maybe I could give this option if no matches are found...
    Running AspDotNetStorefront ML 8.0.1.4

  5. #5
    Sennaya is offline Member
    Join Date
    Dec 2008
    Location
    http://www.ecscase.com
    Posts
    91

    Default simpe to advanced search form

    That is what I do, place a simple text area and search button (edited out of the advanced search page form) on pages results are posted in an advanced search page with the search descriptions radio button availalble in case more detailed searches are desired. Works great.

    <script type="text/javascript" Language="JavaScript">
    function SearchForm2_Validator(theForm)
    {
    submitonce(theForm);
    if (theForm.SearchTerm.value.length < 3)
    {
    alert('Please enter at least 3 characters in the Search For field.');
    theForm.SearchTerm.focus();
    submitenabled(theForm);
    return (false);
    }
    return (true);
    }
    </script>

    <form method="GET" action="http://www.YOURDOMAIN.com/searchadv.aspx" onsubmit="return validateForm(this)" name="AdvSearchForm" id="AdvSearchForm">

    <table border="0" align="left" cellpadding="2" cellspacing="0" >
    <tr align="left">
    <td align="left" valign="top"><input type="hidden" name="IsSubmit" value="true" /><input type="text" name="SearchTerm" size="10" maxlength="30" value="" /><input type="hidden" name="SearchTerm_Vldt" value="[req][len=3][blankalert=Enter search]" /><td>

    <td align="left" valign="top"><input type="submit" value="Search" name="SubmitSearch" id="SubmitSearch" /></td>
    </tr>
    </table>
    </form><script type="text/javascript" Language="JavaScript">
    document.AdvSearchForm.SearchTerm.focus();
    </script>