如何在google Search Appliance中设置没有“site”参数的网址?

时间:2014-08-27 04:27:49

标签: google-search-appliance

 <a class="dn-link" style=" color: #fff;"
    href="{$gsa_search_root_path_prefix}?{$all_results_url}">All results</a> 

从上面的网址我想删除Site参数,因为我想将自己的集合作为网站参数传递,如下所示

<a class="dn-link" style=" color: #fff;"
    href="{$gsa_search_root_path_prefix}?{$all_results_url}&amp;site=erp_collection ">  results</a>

希望有人会帮助我。

1 个答案:

答案 0 :(得分:1)

该变量来自:

<xsl:variable name="all_results_url"><xsl:value-of
          select="$no_q_dnavs_params"/>&amp;q=<xsl:value-of select="$original_q"/>
</xsl:variable>

由以下内容制作:

<!-- *** url without q and dnavs param *** -->
<xsl:variable name="no_q_dnavs_params">
  <xsl:for-each
      select="/GSP/PARAM[(@name != 'start') and
                         (@name != $embedded_mode_root_path_param) and
                         (@name != $embedded_mode_resource_root_path_param) and
                         (@name != $embedded_mode_disable_style) and
                         (@name != 'swrnum') and
                         (@name != 'q') and
                         (@name != 'dnavs') and
                         (@name != 'epoch' or $is_test_search != '') and
                         not(starts-with(@name, 'metabased_'))]">
    <xsl:choose>
      <xsl:when test="@name = 'ip' and $show_ips_in_search_url = '0'">
        <!-- do nothing to remove 'ip' from the URL -->
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="@name"/><xsl:text>=</xsl:text>
        <xsl:value-of select="@original_value"/>
      </xsl:otherwise>
    </xsl:choose>
    <xsl:if test="position() != last()">
      <xsl:text disable-output-escaping="yes">&amp;</xsl:text>
    </xsl:if>
  </xsl:for-each>
</xsl:variable>

因此,您可以在不使用site参数的情况下使您的变量更新:

 <xsl:variable name="no_q_dnavs_params">
      <xsl:for-each
          select="/GSP/PARAM[(@name != 'start') and
                             (@name != $embedded_mode_root_path_param) and
                             (@name != $embedded_mode_resource_root_path_param) and
                             (@name != $embedded_mode_disable_style) and
                             (@name != 'swrnum') and
                             (@name != 'site') and
                             (@name != 'epoch' or $is_test_search != '') and
                             not(starts-with(@name, 'metabased_'))]">
        <xsl:choose>
          <xsl:when test="@name = 'ip' and $show_ips_in_search_url = '0'">
            <!-- do nothing to remove 'ip' from the URL -->
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="@name"/><xsl:text>=</xsl:text>
            <xsl:value-of select="@original_value"/>
          </xsl:otherwise>
        </xsl:choose>
        <xsl:if test="position() != last()">
          <xsl:text disable-output-escaping="yes">&amp;</xsl:text>
        </xsl:if>
      </xsl:for-each>
    </xsl:variable>

但是,我认为你想在那里开始,dnavs和查询。无论哪种方式,只需更改!=以从变量中排除该参数。