Adding query or filter query parameters to the final Solr query

You can add query or filter query parameters to the final Solr query to restrict the documents that can be returned.

Query parameters influence relevancy scores, as they are considered mandatory queries. However, filter queries do not influence relevancy scores. Filter queries can be useful for speeding up complex queries, since they are cached independently from the main query.

Procedure

Add a custom expression in the getData tag in the workspace_dir\crs-web\WebContent\Widgets_801\Common\SearchSetup.jspf file.
For example, to remove BundleBean from searches:

<c:set var="customExpr" value="-catenttype_id_ntk_cs:BundleBean" scope="request"/>
 
    <wcf:getData type="com.ibm.commerce.catalog.facade.datatypes.CatalogNavigationViewType" var="catalogNavigationView"
        expressionBuilder="${navigationView}" scope="request" varShowVerb="showCatalogNavigationView"
        maxItems="${pageSize}" recordSetStartNumber="${beginIndex}" scope="request">
        <wcf:param name="searchProfile" value="${searchProfile}" />
        <wcf:param name="searchTerm" value="${newSearchTerm}" />
        <wcf:param name="intentSearchTerm" value="${intentSearchTerm}" />
        <wcf:param name="searchType" value="${searchType}" />
        <wcf:param name="searchSource" value="${WCParam.searchSource}" />
        <wcf:param name="metaData" value="${WCParam.metaData}" />
        <wcf:param name="orderBy" value="${WCParam.orderBy}" />
        <c:forEach var="facetValue" items="${paramValues.facet}">
            <wcf:param name="facet" value="${facetValue}" />
        </c:forEach>
        <wcf:param name="advancedFacetList" value="${newAdvancedFacetList}"/>
        <wcf:param name="categoryId" value="${currentCategoryId}" />
        <wcf:param name="filterTerm" value="${newFilterTerm}" />
        <wcf:param name="filterType" value="${WCParam.filterType}" />
        <wcf:param name="filterFacet" value="${WCParam.filterFacet}" />
        <wcf:param name="manufacturer" value="${newManufacturer}" />
        <wcf:param name="minPrice" value="${WCParam.minPrice}" />
        <wcf:param name="maxPrice" value="${WCParam.maxPrice}" />
        <wcf:param name="customExpr" value="${customExpr}" />
        <wcf:contextData name="storeId" value="${WCParam.storeId}" />
        <wcf:contextData name="catalogId" value="${WCParam.catalogId}" />

    </wcf:getData>