搜索问题之一:SiteFactory3.6多个一级文章节点的文章无法全部搜索出来

作者:动易网络 来源:本站原创 点击数: 发布时间:2011年01月20日

问题:多个一级文章节点,无法搜索出所有栏目的文章?

 

解决方法:

第一步:修改“文章栏目内搜索”标签的查询语句,如下:

SELECT NodeID,arrChildID FROM PE_Nodes WHERE NodeId = @parentId

改为:

SELECT NodeID,arrChildID FROM PE_Nodes WHERE parentId in (@parentId)

 

第二步:修改“文章栏目内搜索”标签内容,如下,去掉红色部分代码:















  •      没有任何相关搜索结果!
       

  •   
      
        {PE.Label id="文章栏目内搜索_" titleLength="" contentLength="" linkOpenType="" fieldValue="" queryCond="SELECT TOP @pagesize *
        FROM PE_CommonModel CM INNER JOIN PE_U_Article UT ON (CM.ItemID = UT.ID)
        WHERE CM.NodeID IN () AND CM.Status = 99


          AND CM.Title LIKE '%%'


          AND UT.Content LIKE '%%'


          AND UT.Author LIKE '%%'


          AND CM.Inputer LIKE '%%'


          AND UT.Keyword LIKE '%%'

    AND CM.GeneralID NOT IN (
        SELECT TOP @startrow ICM.GeneralID
        FROM PE_CommonModel ICM INNER JOIN PE_U_Article IUT ON ICM.ItemID = IUT.ID
        WHERE ICM.NodeID IN () AND ICM.Status = 99


          AND ICM.Title LIKE '%%'


          AND IUT.Content LIKE '%%'


          AND IUT.Author LIKE '%%'


          AND ICM.Inputer LIKE '%%'


          AND IUT.Keyword LIKE '%%'


        ORDER BY ICM.UpdateTime)
        ORDER BY CM.UpdateTime" queryCount="SELECT COUNT (ICM.GeneralID)
        FROM PE_CommonModel ICM INNER JOIN PE_U_Article IUT ON ICM.ItemID = IUT.ID
        WHERE ICM.NodeID IN () AND ICM.Status = 99


          AND ICM.Title LIKE '%%'


          AND IUT.Content LIKE '%%'


          AND IUT.Author LIKE '%%'


          AND ICM.Inputer LIKE '%%'


          AND IUT.Keyword LIKE '%%'

    " page="true" pagesize="" urlpage="true" /}

     
     
       

     

    第三步:修改“网站顶部”标签,相应nodeId值改为指向全站,如下:

                switch (modelId) {
                    case 1:
                        location.href = '{PE.SiteConfig.ApplicationPath/}search.aspx?searchtype=1&modelId=' + modelId + '&nodeId=1&fieldOption=title&Keyword=' + searchValue;
                        break;
                    case 2:
                        location.href = '{PE.SiteConfig.ApplicationPath/}search.aspx?searchType=1&modelId=' + modelId + '&nodeId=2&fieldOption=title&Keyword=' + searchValue;
                        break;
                    default:
                        location.href = '{PE.SiteConfig.ApplicationPath/}search.aspx?searchtype=1&modelId=' + modelId + '&nodeId=3&fieldOption=title&Keyword=' + searchValue;
                        break;
                }

    改为:

                switch (modelId) {
                    case 1:
                        location.href = '{PE.SiteConfig.ApplicationPath/}search.aspx?searchtype=1&modelId=' + modelId + '&nodeId=0&fieldOption=title&Keyword=' + searchValue;
                        break;
                    case 2:
                        location.href = '{PE.SiteConfig.ApplicationPath/}search.aspx?searchType=1&modelId=' + modelId + '&nodeId=2&fieldOption=title&Keyword=' + searchValue;
                        break;
                    default:
                        location.href = '{PE.SiteConfig.ApplicationPath/}search.aspx?searchtype=1&modelId=' + modelId + '&nodeId=3&fieldOption=title&Keyword=' + searchValue;
                        break;
                }