Troubleshooting: Product sequencing issues

Set a predefined order for the appearance of your products in WebSphere Commerce Search results.


Products returned by searches do not appear in the order you prefer.


Sequencing allows you to set a predefined display order for products in a category. You can set a sequence value for each product. When browsing categories, you will want to order products in a way that will drive the most sales.

Ensure that you have the following fixes applied. They contain the most up-to-date version of the sequencing function:
Types of sequencing
  1. Shallow Sequencing: Determining sequence of results based on product's sequence value.

    Shallow sequencing is normally used when you are not using deep search (showing products under category and it's subcategories), but can also be used with deep search if you don't want the category's sequence value to be taken into account.

  2. Deep Sequencing: Determining sequence of results based on the product and category's sequence value.

    Deep sequencing allows the category sequence value to be taken into account so that products under a category with a low sequence value can be pushed to the top of the results. It's important to know what sequencing behaviour you want for your storefront, as each type of sequencing can result in significantly different results.

You can determine which type of sequencing your system is using by examining your search queries. The sort parameter of the query identifies the sequencing function.
Shallow Sequencing: sort=getSequenceByCatalogAndCategory(sequence,'catalogId','categoryId') asc
Deep Sequencing: sort=getDeepSequence(globalSequence,catalogId,categoryId) asc
Setting the sequencing type
The sequence may not be correct even though the sort parameter shows the right sequencing type. There are two configuration settings that can affect the sequencing result.
  1. Ensure that the EnableDeepProductSequence parameter is correctly set in the Search_eardir/xml/config/ file.
    <_config:property name="EnableDeepProductSequence" value="false" />
  2. The correct sequencing function parser must be defined for each sequencing function.
    <valueSourceParser name="getSequenceByCatalogAndCategory" 
        class="" />
    <valueSourceParser name="getDeepSequence" 
        class="" />
If these settings are correct, you can test the results by querying the index for products under the category in question, and sorting based on the sequencing function. Execute the following query against the CatalogEntry core:
You can verify in the response whether the catentry_ids being returned have the expected sequence values.
<lst name="responseHeader">
      <int name= " status ">0</int>
      <int name="QTime">1</int> 
      <lst name="params"> 
        <Str name="q">*:*</str>
        <str name="fl">catentry_id,sequence</str> 
<Str name="rows">100</str>
        <Str name= "fq ">parentCatgroup_id_search: 10101_10118</str> 
   <result name="response" numFound="88" start="0">
        <arr name="sequence">
<str name="catentry_id">15316</str> 
        <arr name="sequence"> 
           <str name="catentry_id">15404</str>       
If the wrong sequence values are being indexed, then check whether the preprocessing functions are retrieving the correct sequence values from the database. You can review the contents of the TI_CATGPENREL_#indexScopeTag# to confirm that the sequence value for the catentry matches what you see in Management Center. If this table does not have the correct sequence value, then review the query you are using in wc-dataimport-preprocess-common.xml to retrieve data for the table.

If the correct sequence values are being indexed, review the results to confirm that the sequencing function is sorting the results properly.