Thursday, November 13, 2014

Debugging Solr Search Sort Issue on Department(Category) pages

It loads the page Layouts/CategoryNavigationResults.jsp and when selecting different sort options
When debugging the Ajax call in the Net tab, you will see the orderBy value corresponding to the values defined in the search profile.
http://localhost/CategoryNavigationResultsView?searchType=&filterCollQuery=&langId=-1&beginIndex=0&sType=SimpleSearch&metaData=&pageSize=48&manufacturer=&resultCatEntryType=&catalogId=10051&productBeginIndex=0&categoryId=13632&storeId=10151&filterFacet=
beginIndex=0
catalogId=10051
contentBeginIndex=0
facet=
isHistory=false
langId=
maxPrice=
minPrice=
objectId=
orderBy=6
orderByContent=
pageSize=0
pageView=grid
productBeginIndex=0
requesttype=ajax
resultType=products
searchTerm=
storeId=10151
Enable Trace:
*=info: com.ibm.commerce.catalog.*=all: com.ibm.commerce.foundation.*=all: com.ibm.commerce.search.*=all

Search in trace.log: Find searchProfile=[IBM_ in logs
e.g: found
searchProfile=[IBM_ComposeFacetListByCategoryId]
schema.xml  : Make sure the entries are correctly available in the schema file
      <field name="abcRanking" type="tfloat" indexed="true" stored="false" multiValued="false" />
 <field name="abcRanking_display" type="float" indexed="true" stored="true" multiValued="false" />


Do not make any customization's to the FEP for this file and this would have performance impact and would cause multiple issues in future upgrades.
There are targetable versions for each environment wc-search.xml, make sure
Find the corresponding search profile in extended wc-search.xml
 <_config:profile indexName="CatalogEntry" name="IBM_ComposeProductListByCategoryId">


Check for the attribute value in the database by running in DB
select av.value,cat.partnumber,cat.catentry_id from attrvaldesc av, catentryattr cattr, attr a, catentry cat where
av.attrval_id = cattr.attrval_id
and cattr.attr_id = a.attr_id
and cattr.catentry_id =cat.catentry_id
and a.identifier='abcAttribute' order by value desc

Make sure the attribute is searchable:

Check for the Attribute in the following tables:

It is possible that attrdictsrchconf .SRCHFIELDNAME is mapped to a different name than the actual attribute name in

select * from attrdictsrchconf where attr_id in (select attr_id from attr where identifier in ('abcAttribute'))

select * from srchattr where identifier like '%abcAttribute';

C:\IBM\WCDE_ENT70\workspace\WC\xml\config\com.ibm.commerce.catalog-fep\wc-search.xml
C:\IBM\WCDE_ENT70\workspace\WC\xml\config\com.ibm.commerce.catalog-ext\wc-search.xml

    <_config:profile indexName="CatalogEntry" name="IBM_ComposeProductListByCategoryId">
        <_config:query>
            <_config:param name="maxRows" value="50"/>
            <_config:param name="maxTimeAllowed" value="15000"/>
            <_config:provider classname="com.ibm.commerce.catalog.facade.server.services.search.expression.solr.SolrSearchByCategoryExpressionProvider"/>
            <_config:provider classname="com.ibm.commerce.catalog.facade.server.services.search.expression.solr.SolrSearchByManufacturerExpressionProvider"/>
            <_config:provider classname="com.ibm.commerce.catalog.facade.server.services.search.expression.solr.SolrSearchByPriceExpressionProvider"/>
            <_config:provider classname="com.ibm.commerce.catalog.facade.server.services.search.expression.solr.SolrSearchByFacetExpressionProvider"/>
            <_config:provider classname="com.ibm.commerce.catalog.facade.server.services.search.expression.solr.SolrSearchByStorePathExpressionProvider"/>
            <_config:provider classname="com.ibm.commerce.catalog.facade.server.services.search.expression.solr.SolrSearchByPublishedEntryOnlyExpressionProvider"/>
            <_config:provider classname="com.ibm.commerce.catalog.facade.server.services.search.expression.solr.SolrSearchByCustomExpressionProvider"/>
            <_config:provider classname="com.ibm.commerce.catalog.facade.server.services.search.expression.solr.SolrSearchFacetConditionExpressionProvider"/>
            <_config:provider classname="com.ibm.commerce.catalog.facade.server.services.search.expression.solr.SolrSearchTypeExpressionProvider"/>
            <_config:provider classname="com.ibm.commerce.catalog.facade.server.services.search.expression.solr.SolrSearchSequencingExpressionProvider"/>
            <_config:provider classname="com.ibm.commerce.catalog.facade.server.services.search.expression.solr.SolrSearchProductEntitlementExpressionProvider"/>
            <_config:field name="name"/>
        </_config:query>
        <_config:sort>
            <_config:field name="1" value="mfName_ntk asc"/>
            <_config:field name="2" value="name_ntk asc"/>
            <_config:field name="3" value="price_* asc"/>
            <_config:field name="4" value="price_* desc"/>
            <_config:field name="5" value="quantitySold desc"/>
            <_config:field name="6" value="abcRanking desc" />
            <_config:field name="7" value="totalPriceSold desc"/>
        </_config:sort>
        <_config:result>
            <_config:filter classname="com.ibm.commerce.catalog.facade.server.services.search.metadata.SearchCatalogEntryViewPriceResultFilter"/>
            <!--
            <_config:filter classname="com.ibm.commerce.catalog.facade.server.services.search.metadata.SearchCatalogEntryViewSingleSKUResultFilter"/>
            -->
            <_config:filter classname="com.ibm.commerce.catalog.facade.server.services.search.metadata.SearchCatalogNavigationViewPreviewResultFilter"/>
            <_config:filter classname="com.ibm.commerce.catalog.facade.server.services.search.metadata.SearchCatalogNavigationViewDynamicKitResultFilter"/>
            <_config:filter classname="com.ibm.commerce.catalog.facade.server.services.search.metadata.SearchCatalogEntryViewDescriptionResultFilter"/>
            <_config:filter classname="com.custom.commerce.search.query.solr.SolrFacetEntryViewImageAndSequenceResultFilter"/>
        </_config:result>
        <_config:facets>
            <_config:param name="sort" value="count"/>
            <_config:param name="minCount" value="1"/>
            <_config:param name="limit" value="200"/>        
        </_config:facets>
    </_config:profile>

10 comments:

  1. It is not, at that point, a straightforward matter of making a twofold installment one month from now in addition to somewhat additional for charges, since the advances are not figured on typical loan fees. What really happens is more extreme than only a basic charge.

    ReplyDelete
  2. Further, instead of holding up days or half a month for a choice, numerous online organizations will react inside a few hours. Rivalry in this market is savage, so they will do what it takes to get your business.

    ReplyDelete
  3. Since they represent considerable authority in these credits, it is typically a simple, quick procedure to get the cash that you require. Cash Advance Corona

    ReplyDelete
  4. The controls for vehicle title credits shift from state to state. In New Mexico, online loan specialists don't require that you live in the state. Car Title Loans

    ReplyDelete
  5. Buenas!! que interesante tu artículo, ha sido una información muy útil que estoy segura que usaré. Estoy deseando que subas nuevo contenido pronto. saludos <3

    ReplyDelete
  6. Me gusta mucho tu página en general y este artículo en particular me ha encantado, siento que le dedicas mucho tiempo y que disfrutas lo que haces. mucha suerte!!!

    ReplyDelete
  7. No se si estoy de acuerdo con todo lo que has escrito pero sin ninguna duda lo haces desde el respeto y la educación. Tener puntos de vista distintos a los míos es una oportunidad para poder aprender cosas nuevas. Deseando que subas más contenido. Un saludo!!!

    ReplyDelete
  8. No tenía mucha idea acerca del tema y la verdad es que vuestra información ha sido muy útil e instructiva, he aprendido muchas cosas que podré poner en práctica a partir de ahora. ¡Muchas gracias!

    ReplyDelete
  9. La verdad es que la información es buena y amena, su fácil comprensión me ha atrapado desde el primer momento y ha conseguido que me informe de lo que quería saber. Se nota que estás encantado con lo que haces. =)

    ReplyDelete
  10. No es lo que estaba buscando ahora mismo, pero el post me ha llamado bastante la atención ya que te cuenta cosas interesantes que pueden ser útiles, encima se nota que le has puesto mucho esfuerzo ¡felicidades!

    ReplyDelete