Product index query result is missing extension index fields

Fields defined in the extension index are not returned when making search queries against the product index.

Problem

This problem can manifest in two ways.
  1. A custom field of the inventory index is indexed and the search query includes that field among other fields in the fl query parameter. Suppose that the custom field is called inv_status. The query is as follows.
    http://localhost:3737/solr/MC_10001_CatalogEntry_en_US/select?...&fl=catentry_id,name,inv_status&...
    The inv_status field will not be listed in the returned documents as seen in the query response below, even though it was specified in the query.
    <result name="response" start="O" numFound="910"> 
      <doc> 
        <str name="catentry_id">10001</str> 
        <str name="name"> Hermitage Fit and Flare Dress </str>
      </doc>
      <doc>
        <str name="catentry_id">10003</str> 
        <str name="name">Luigi Valenti Empire Waist Slip Dress </str> 
      </doc> 
      <doc> 
        <str name="catentry_id">10004</str> 
        <str name="name" > Hermitage Pencil Dress </str> 
      </doc>
      <doc> 
        <str name="catentry_id">10005</str> 
        <str name="name">Albini Straight Cocktail Dress </str> 
      </doc>
      <doc> 
        <str name="catentry_id">10006</str>
        <str name="name" > Luigi Valenti Strapless Cocktail Dress </str>
      </doc>
    
  2. The problem can also occur when the extension index does not have the indexed data available at the time that the search request is made. This issue could occur if index replication of the extension index did not complete or was otherwise compromised.

Solution

Ensure that the catalogEntry index document cache is configured correctly. This cache must be large enough to contain the largest number of results a search query can generate. The size must also be proportional to the page size of the query. Note that some queries could return far more results that the number of products being displayed in the result page. This can occur because products' SKUs and attachments are also considered in some queries, depending on what REST services or search type is being used.

In cases where the indexed data is not present in the extension index, ensure that the production nodes' index version is the same as the master/repeater servers.' You can check whether the index versions are synchronized by running a health check test query. One way of doing this is by simply running the following URL for every node in the production cluster.
http://localhost:3737/solr/MC_10001_CatalogEntry_en_US/replication?command=details
In the response, compare both indexVersion values and ensure that they are the same.