Index

The Model Loading Engine creates product indexes and processes the incoming product models to index them in the Offer Search Engine.

Product Index

To create a product index for each tenant, the tenant has to be configured in the application configuration. See External Application Logging Configuration for more information.

At startup, the Model Loading Engine tries to create a product index for all the configured tenants by calling The Create Index API of the Offer Search Engine. This creates an <tenant id>__Product index in the Offer Search Engine.

Index Mapping
  • By default, the Offer Search Engine uses the existing incoming product model to create the corresponding domain object. To support TIBCO OPE based queries and dynamic product model changes, a custom index mapping file is used. This file is used as an input along with the source product model document to index.
  • For full-text purposes, all the fields eligible for full-text search are copied in the productFullTextSearch field of the product mapping file so that search is executed only across on field instead of insert multiple fields in the search query.
  • The category from the product is mapped as follows:
    "categories" : {
         "type": "nested",
         "properties" : {
           "name" : {
             "copy_to": "productFullTextSearch",
             "type": "keyword"
           },
           "childCatList" : {
             "properties" : {
               "name" : {
                 "copy_to": "productFullTextSearch",
                 "type": "keyword"
               },
               "childCatList" : {
                 "properties" : {
                   "name" : {
                     "copy_to": "productFullTextSearch",
                     "type": "keyword"
                   },
                   "level" : {
                     "type" : "long"
                   }
                 }
               },
               "level" : {
                 "type" : "long"
               }
             }
           },
    
    
  • Segment mapping is as follows:
     "compatibleSegments": {
         "type": "nested",
         "properties": {
           "segmentName": {
             "copy_to": "productFullTextSearch",
             "type": "keyword"
           },
           "segmentType": {
             "copy_to": "productFullTextSearch",
             "type": "keyword"
           }
         }
       },
    
  • Record Type/ Sub Types are nested as follows:
    "classification": {
         "type": "nested",
         "properties": {
           "type": {
             "copy_to": "productFullTextSearch",
             "type": "keyword"
           },
           "subType": {
             "copy_to": "productFullTextSearch",
             "type": "keyword"
           }
         }
       },
    

    Classifications have types that contain sub types as a part of the model, this enables aggregation on type ad sub type elements.

  • Suggestion terms are mapped as follows:
    "suggestionTerms": {
         "type":"text",
         "fields": {
           "keyword": {
             "type": "keyword",
             "ignore_above": 256
           }
         }
       }
    
  • Category attributes are mapped as follows:
    "filterAttributes": {
         "type":"nested",
         "properties": {
           "name": {
             "copy_to": "productFullTextSearch",
             "type": "keyword"
           },
           "value": {
             "copy_to": "productFullTextSearch",
             "type": "keyword"
           }
         }
       },
    

Indexing Product Documents

After the model loading engine has started and the tenant index created, the engine can process models and index them against Offer Search Engine product index. The model loading engine indexes the product models as follows:
  1. Loads models for processing (from online and offline modes) and parses them.
  2. Sends the models to the Offer Search Engine for indexing against tenant based product index created earlier. The products are indexed in bulk and will index all products present per product model xml file at the same time. For example, if the product model xml contains ten products, all ten products will be indexed together in a single request instead of ten individual requests.