Browse

The Search API presents filters and attributes that enables you browse using category, segment, and record types and subtypes as specified in the Product data model.

This functionality enables you to browse for products using the following navigation paths:

  • Category

    You can browse for products using the category (or categories) modeled in the Product data model. This feature is implemented by using the category name against the indexed product models in the Offer Search Engine. For example, using the category-based filters you are presented with aggregate values such as the total number of offers for a specific or all categories, the offers for a particular category or categories, or offers filtered based on attributes of a category.

    Categories are loaded into the Offer Search Engine using the Model Loading Engine. The Category data model contains a root category along with the subcategories and the associated characteristics.

    The Product data model is related to the Category data model by the relationship defined in the Product data model. When a product with the category relationship is indexed in the Offer Search Engine, guided browsing is enabled using the implemented aggregation API calls.

    The Offer Search Engine uses the Category model to maintain a list of the categories present in the OP Core engine. Using these models, you can query the categories and subcategories to reach the leaf categories for a specific root category.

    Note: For more information on the Category API web service, refer to the offerpriceservice-spec.yaml file.
    Use cases for browse functionality:
    • Browse all categories with count - Returns all the categories present in the product models along with the count. The following flag is used to aggregate all categories: "aggAllCategories":"true"
      {
      	"aggAllCategories":"true"
      }
      Response payload
      
    • Browse specific categories with count - The search engine exposes Get Categories REST api which returns the root category along with sub categories. The user can drill down to the leaf category and then use the Search API to get the total number of products available for a leaf category with optionally returning those products. This is enabled by turning the request attribute "aggregate=true" as in the following request sample:
      {
      	"aggAllCategories":"false",
      	"searchOfferQuery" : {
      		"aggregate" : "true",
      		"globalAggregate" : "false",
      		"categories" : [
      			{
      				"id": "test1",
      				"name": "WEB"
      			}
      		]
      		
      	}
      }
      
    • Browse specific category along with other categories - Supports browsing a specific category and returns offers and their count. Additionally it also returns all other categories present in all product models. This is useful particularly in use cases where there is a need to filter by particular category and also maintain the global context of all categories (modeled in product model) and their counts:
      {
      "aggAllCategories":"false",
      	"searchOfferQuery" : {
      		"aggregate" : "false",
      		"globalAggregate" : "true",
      		"categories" : [
      		{
      			"id": "test1",
      			"name": "WEB"
      		}
      		]
      		
      }
      }
      
    • Category attribute based browse and filters - This functionality supports browsing and search of products based on different category attributes. Category attributes are modeled as characteristics in Category model with characteristic name as the attribute of that category. The corresponding characteristic is modeled in the product model linked to that category with the value of that attribute. The engine this way determines the characteristics belonging to the category being browsed or searched and returns the offers and their count per filter. To enable just browsing the characteristics for particular category, the following request payload is used:
      {
      	"searchOfferQuery" : {
      		"aggregate" : "true", // to get count of all products
      		"globalAggregate" : "false",
      		"attributes":"true",
      		"categories" : [
      			{
      				"id": "test1",
      				"name": "category_2"
      			}
      		]
      		
      	}
      }
      						Response Payload
       {
          "totalHits": 1,
          "offers": {
              "offer": [
                  {
                      "offerId": "PROD_A1",
                      "offerDescription": ""
                  }
              ]
          }
          "categoryAggregations": {
              "currentTotal": 1,
              "otherTotal": 0,
              "categories": [
                  {
                      "name": "test1",
                      "currentTotal": 1,
                      "otherTotal": 0,
                      "id": null
                  }
              ]
          },
          "filterAggregations": {
              "total": 2,
              "filterAggregations": [
                  {
                      "currentTotal": 1,
                      "otherTotal": 0,
                      "id": "IMP_DATE",
                      "childFilterAggregations": [
                          {
                              "currentTotal": 1,
                              "otherTotal": 0,
                              "id": "Samsung",
                              "childFilterAggregations": []
                          }
                      ]
                  }
              ]
          },
          "global": {
              "segmentAggregations": null,
              "categoryAggregations": null,
              "recordClassAggregations": null
          }
      }
      
  • Category attribute based range filter

    This filter supports product browsing and search based on different category attributes and range filters. Category attributes are modeled as characteristic names in the Category model. The corresponding characteristic is modeled in the product model linked to the category and takes the value of the category attribute. Modeling enables the search engine to determine the characteristics of the browsed or searched category. The search engine returns the results and their count, according to the range filter criteria provided in the query.

    Using the filter's search criteria, minRange and maxRange (integer or double data type), you can search for characteristics that include the externalRuleset attribute where the value of the RANGE_VALUE parameter is true, and where the discreteValue attribute has a data type of integer or double. If the characteristic contains a discreteValue attribute with a char or string data type, the system logs a parsed error and the characteristic is not processed.

    Note: Elasticsearch range aggregation excludes the from value (minRange) and includes the to value (maxRange) for each range. However, if the range limit (lowerbound or upperbound) in the range filter is x.5, the search engine uses rounded range limit to round off the value to x.6.

    For example, when aggregating cellphones from a 5 to a 5.5 screen size, the search engine changes the upperbound limit (5.5) to 5.6, applying the elasticsearch range aggregation from a 5 to a 5.6 screen size.

    Use the following payload to enable browsing for characteristics with a range filter:
    {
       "searchOfferQuery":{
          "aggregate":"true",    // to get count of all products
          "globalAggregate":"true",
          "attributes":"true",
          "categories":[
             {
                "id":"CellPhones",
                "name":"CellPhones"
             }
          ]
       },
       "attributeFilters":{
    		"ranges":[{
    				"attributeName":"ScreenSize",
    				"minRange":5,
    				"maxRange":8
    		}]
    	}
    }
    
    Response payload:
    {
      "totalHits": 9,
      "offers": {
        "offer": [
          {
            "offerId": "iPhone11-Black",
            "offerDescription": "iPhone11 Black from Apple"
          },
          {
            "offerId": "s10-red",
            "offerDescription": "Samsung Galaxy s10 Red"
          },
          
          {
            "offerId": "iPhone11-Black-Max",
            "offerDescription": "iPhone11 Black Max from Apple"
          },
          {
            "offerId": "vivo",
            "offerDescription": "vivo"
          },
          {
            "offerId": "redmi",
            "offerDescription": "redmi"
          },
          {
            "offerId": "s10-silver",
            "offerDescription": "Samsung Galaxy s10 Silver"
          },
          {
            "offerId": "s10-black",
            "offerDescription": "Samsung Galaxy s10 Red"
          },
          {
            "offerId": "iPhone11-gold",
            "offerDescription": "iPhone11 Gold from Apple"
          }
          {
            "offerId": "oppo",
            "offerDescription": "oppo"
          }
        ]
      },
      "segmentAggregations": {
        "currentTotal": 0,
        "otherTotal": 0,
        "types": []
      },
      "categoryAggregations": {
        "currentTotal": 9,
        "otherTotal": 0,
        "categories": [
          {
            "name": "CellPhones",
            "currentTotal": 9,
            "otherTotal": 0,
            "id": null
          }
        ]
      },
      "offerClasses": {
        "currentTotal": 0,
        "otherTotal": 0,
        "id": null,
        "types": []
      },
      "filterAggregations": {
        "total": 36,
        "filterAggregations": [
          {
            "currentTotal": 9,
            "otherTotal": 0,
            "id": "Color",
            "childFilterAggregations": [
              {
                "currentTotal": 5,
                "otherTotal": 0,
                "id": "Gold",
                "childFilterAggregations": [],
                "childRangeFilterAggregations": []
              },
              {
                "currentTotal": 3,
                "otherTotal": 0,
                "id": "Black",
                "childFilterAggregations": [],
                "childRangeFilterAggregations": []
              },
              {
                "currentTotal": 1,
                "otherTotal": 0,
                "id": "Red",
                "childFilterAggregations": [],
                "childRangeFilterAggregations": []
              }
            ],
            "childRangeFilterAggregations": []
          },
          {
            "currentTotal": 9,
            "otherTotal": 0,
            "id": "Brands",
            "childFilterAggregations": [
              {
                "currentTotal": 3,
                "otherTotal": 0,
                "id": "Apple",
                "childFilterAggregations": [],
                "childRangeFilterAggregations": []
              },
              {
                "currentTotal": 3,
                "otherTotal": 0,
                "id": "Samsung",
                "childFilterAggregations": [],
                "childRangeFilterAggregations": []
              }
                        {
                "currentTotal": 1,
                "otherTotal": 0,
                "id": "oppo",
                "childFilterAggregations": [],
                "childRangeFilterAggregations": []
              },
              {
                "currentTotal": 1,
                "otherTotal": 0,
                "id": "redmi",
                "childFilterAggregations": [],
                "childRangeFilterAggregations": []
              },
              {
                "currentTotal": 1,
                "otherTotal": 0,
                "id": "vivo",
                "childFilterAggregations": [],
                "childRangeFilterAggregations": []
              }
            ],
            "childRangeFilterAggregations": []
          },
          {
            "currentTotal": 9,
            "otherTotal": 0,
            "id": "MemoryStorage",
            "childFilterAggregations": [
              {
                "currentTotal": 8,
                "otherTotal": 0,
                "id": "64G",
                "childFilterAggregations": [],
                "childRangeFilterAggregations": []
              },
              {
                "currentTotal": 1,
                "otherTotal": 0,
                "id": "128G",
                "childFilterAggregations": [],
                "childRangeFilterAggregations": []
              }
            ],
            "childRangeFilterAggregations": []
          },
          {
            "currentTotal": 9,
            "otherTotal": 0,
            "id": "ScreenSize",
            "childFilterAggregations": [],
            "childRangeFilterAggregations": [
              {
                "currentTotal": 9,
                "otherTotal": 0,
                "id": "ScreenSize",
                "from": 5,
                "to": 8,
                "childFilterAggregations": []
              }
            ]
          }
        ]
      },
      "global": {
        "segmentAggregations": {
          "currentTotal": 0,
          "otherTotal": 0,
          "types": []
        },
        "categoryAggregations": {
          "currentTotal": 19,
          "otherTotal": 0,
          "categories": [
            {
              "name": "CellPhones",
              "currentTotal": 9,
              "otherTotal": 0,
              "id": null
            },
            {
              "name": "FamilyPlan",
              "currentTotal": 3,
              "otherTotal": 0,
              "id": null
            },
            {
              "name": "Unlimited",
              "currentTotal": 3,
              "otherTotal": 0,
              "id": null
            },
            {
              "name": "Tablets",
              "currentTotal": 2,
              "otherTotal": 0,
              "id": null
            },
            {
              "name": "Watches",
              "currentTotal": 2,
              "otherTotal": 0,
              "id": null
            }
          ]
        },
        "recordClassAggregations": {
          "currentTotal": 0,
          "otherTotal": 0,
          "id": null,
          "types": []
        }
      }
    }
    
  • Record or Subtype

    You can browse for products using the record type modeled in the Product data model. This feature is implemented by using the record name or type against the indexed products in the Offer Search Engine. For example, using the record type based filters you are presented with aggregate values such as the total number of offers for a specific or all segments or the offers for a particular segment. All filters may optionally contain both the record name and type.

    The product is related to the record type and the subtype by the characteristics in the Product data model. When a product with the record and subtype relationship is indexed in the Offer Search Engine, guided browsing is enabled using the implemented aggregation API calls.

    Using these models, you can browse all record types and subtypes, and additionall, you can use the total number of products that meet the specified criteria. For example:
    Request
    {
    	
    	"aggOfferClasses" :"true",
    	"searchOfferQuery" : {
    		"aggregate" : "true",
    		"globalAggregate" : "true",
    		"classes" : [
    			{
    				"id": "test1",
    				"type": "BPO",
    				"names": ["INTERNET","NOWEB"]
    			}
    		]
    	}
    }
    
    response
    {
        "totalHits": 1,
        "offers": {
            "offer": [
                {
                    "offerId": "Prod108_TFOM-5410",
                    "offerDescription": "Prod108_TFOM-5410"
                }
            ]
        },
        "segmentAggregations": {
            "currentTotal": 0,
            "otherTotal": 0,
            "types": []
        },
        "categoryAggregations": {
            "currentTotal": 0,
            "otherTotal": 0,
            "categories": []
        },
        "offerClasses": {
            "currentTotal": 1,
            "otherTotal": 0,
            "id": null,
            "types": [
                {
                    "currentTotal": 1,
                    "otherTotal": 0,
                    "id": null,
                    "type": "BPO",
                    "subTypes": [
                        {
                            "currentTotal": 1,
                            "otherTotal": 0,
                            "id": null,
                            "name": "Internet"
                        }
                    ]
                },
                {
                    "currentTotal": 1,
                    "otherTotal": 0,
                    "id": null,
                    "type": "BPO",
                    "subTypes": []
                }
            ]
        },
        "filterAggregations": {
            "total": 0,
            "filterAggregations": []
        },
        "global": {
            "segmentAggregations": {
                "currentTotal": 0,
                "otherTotal": 0,
                "types": []
            },
            "categoryAggregations": {
                "currentTotal": 0,
                "otherTotal": 0,
                "categories": []
            },
            "recordClassAggregations": {
                "currentTotal": 35,
                "otherTotal": 0,
                "id": null,
                "types": [
                    {
                        "currentTotal": 16,
                        "otherTotal": 0,
                        "id": null,
                        "type": "ELEMENTO_ABILITATO",
                        "subTypes": []
                    },
                    {
                        "currentTotal": 8,
                        "otherTotal": 0,
                        "id": null,
                        "type": "OFFERTA",
                        "subTypes": []
                    },
                    {
                        "currentTotal": 4,
                        "otherTotal": 0,
                        "id": null,
                        "type": "PO",
                        "subTypes": []
                    },
                    {
                        "currentTotal": 2,
                        "otherTotal": 0,
                        "id": null,
                        "type": "BUNDLE",
                        "subTypes": []
                    },
                    {
                        "currentTotal": 2,
                        "otherTotal": 0,
                        "id": null,
                        "type": "SERVIZIO_ABILITANTE",
                        "subTypes": []
                    },
                    {
                        "currentTotal": 2,
                        "otherTotal": 0,
                        "id": null,
                        "type": "UNCLASSIFIED",
                        "subTypes": []
                    },
                    {
                        "currentTotal": 1,
                        "otherTotal": 0,
                        "id": null,
                        "type": "BPO",
                        "subTypes": [
                            {
                                "currentTotal": 1,
                                "otherTotal": 0,
                                "id": null,
                                "name": "Internet"
                            }
                        ]
                    }
                ]
            }
        }
    }
    
    Set the aggOfferClasses flag to true to aggregate all types and subtypes. For example:
    {
    "aggOfferClasses":"true"
    }
    
    Response
    {
        "totalHits": 37,
        "offers": {
            "offer": [
                {
                    "offerId": "CS1_TFOM-5164",
                    "offerDescription": "CS1_TFOM-5164"
                },
                {
                    "offerId": "TESTIMPORT_PRODUCT5_TFOM-5280",
                    "offerDescription": "TESTIMPORT_PRODUCT5_TFOM-5280"
                },
                {
                    "offerId": "TESTIMPORT_PRODUCT10_TFOM-5280",
                    "offerDescription": "TESTIMPORT_PRODUCT10_TFOM-5280"
                },
                {
                    "offerId": "OB275-TIM_ELITE_TFOM-5280",
                    "offerDescription": "OB275-TIM_ELITE_TFOM-5280"
                },
                {
                    "offerId": "ODR62-TIM_YOUNG_MUSIC_FULL_TFOM-5280",
                    "offerDescription": "ODR62-TIM_YOUNG_MUSIC_FULL_TFOM-5280"
                },
                {
                    "offerId": "SIM_CARD_TFOM-5280",
                    "offerDescription": "SIM_CARD_TFOM-5280"
                },
                {
                    "offerId": "UC1_P2_TFOM-5280",
                    "offerDescription": "P2_TFOM-5280"
                },
                {
                    "offerId": "769214_ITIM_SAMSUNG_GALAXY_S6_32GB_BLACK_TFOM-5280",
                    "offerDescription": "769214_ITIM_SAMSUNG_GALAXY_S6_32GB_BLACK_TFOM-5280"
                },
                {
                    "offerId": "TESTIMPORT_PRODUCT2_TFOM-5280",
                    "offerDescription": "TESTIMPORT_PRODUCT2, TEST COMMA2_TFOM-5280"
                },
                {
                    "offerId": "UC1_SA_TFOM-5280",
                    "offerDescription": "ABILITANTE_TFOM-5280"
                }
            ]
        },
        "segmentAggregations": {
            "currentTotal": 0,
            "otherTotal": 0,
            "types": []
        },
        "categoryAggregations": {
            "currentTotal": 0,
            "otherTotal": 0,
            "categories": []
        },
        "offerClasses": {
            "currentTotal": 35,
            "otherTotal": 0,
            "id": null,
            "types": [
                {
                    "currentTotal": 16,
                    "otherTotal": 0,
                    "id": null,
                    "type": "ELEMENTO_ABILITATO",
                    "subTypes": []
                },
                {
                    "currentTotal": 8,
                    "otherTotal": 0,
                    "id": null,
                    "type": "OFFERTA",
                    "subTypes": []
                },
                {
                    "currentTotal": 4,
                    "otherTotal": 0,
                    "id": null,
                    "type": "PO",
                    "subTypes": []
                },
                {
                    "currentTotal": 2,
                    "otherTotal": 0,
                    "id": null,
                    "type": "BUNDLE",
                    "subTypes": []
                },
                {
                    "currentTotal": 2,
                    "otherTotal": 0,
                    "id": null,
                    "type": "SERVIZIO_ABILITANTE",
                    "subTypes": []
                },
                {
                    "currentTotal": 2,
                    "otherTotal": 0,
                    "id": null,
                    "type": "UNCLASSIFIED",
                    "subTypes": []
                },
                {
                    "currentTotal": 1,
                    "otherTotal": 0,
                    "id": null,
                    "type": "BPO",
                    "subTypes": [
                        {
                            "currentTotal": 1,
                            "otherTotal": 0,
                            "id": null,
                            "name": "Internet"
                        }
                    ]
                }
            ]
        },
        "filterAggregations": {
            "total": 0,
            "filterAggregations": []
        },
        "global": {
            "segmentAggregations": null,
            "categoryAggregations": null,
            "recordClassAggregations": null
        }
    }
    
  • Segment

    You can browse for products using the segment modeled in the Product data model. This feature is implemented by using the segment name or type against the indexed products in the Offer Search Engine. For example, using the segment type or name based filters you are presented with aggregate values such as the total number of offers for a specific or all segments or the offers for a particular segment. All filters may optionally contain both the segment name and type.

    The product is related to the Segment type and the subtype by the compatiblesegment relationship rule in the Product data model. When a product with the segment relationship is indexed in the Offer Search Engine, guided browsing is enabled using the implemented aggregation API calls.

    Using these models you can browse all segment types and you can use the total number of products that meet the specified criteria.

    Set the aggAllSegments flag to true to aggregate all segment names and types. For example:
    {
    "aggAllSegments":"true"
    }
    Response
    {
        "totalHits": 37,
        "offers": {
            "offer": [
                {
                    "offerId": "CS1_TFOM-5164",
                    "offerDescription": "CS1_TFOM-5164"
                },
                {
                    "offerId": "TESTIMPORT_PRODUCT5_TFOM-5280",
                    "offerDescription": "TESTIMPORT_PRODUCT5_TFOM-5280"
                },
                {
                    "offerId": "TESTIMPORT_PRODUCT10_TFOM-5280",
                    "offerDescription": "TESTIMPORT_PRODUCT10_TFOM-5280"
                },
                {
                    "offerId": "OB275-TIM_ELITE_TFOM-5280",
                    "offerDescription": "OB275-TIM_ELITE_TFOM-5280"
                },
                {
                    "offerId": "ODR62-TIM_YOUNG_MUSIC_FULL_TFOM-5280",
                    "offerDescription": "ODR62-TIM_YOUNG_MUSIC_FULL_TFOM-5280"
                },
                {
                    "offerId": "SIM_CARD_TFOM-5280",
                    "offerDescription": "SIM_CARD_TFOM-5280"
                },
                {
                    "offerId": "UC1_P2_TFOM-5280",
                    "offerDescription": "P2_TFOM-5280"
                },
                {
                    "offerId": "769214_ITIM_SAMSUNG_GALAXY_S6_32GB_BLACK_TFOM-5280",
                    "offerDescription": "769214_ITIM_SAMSUNG_GALAXY_S6_32GB_BLACK_TFOM-5280"
                },
                {
                    "offerId": "TESTIMPORT_PRODUCT2_TFOM-5280",
                    "offerDescription": "TESTIMPORT_PRODUCT2, TEST COMMA2_TFOM-5280"
                },
                {
                    "offerId": "UC1_SA_TFOM-5280",
                    "offerDescription": "ABILITANTE_TFOM-5280"
                },
                {
                    "offerId": "TIM_YOUNG_TFOM-5280",
                    "offerDescription": "TIM_YOUNG_TFOM-5280"
                },
                {
                    "offerId": "UC1_G2_TFOM-5280",
                    "offerDescription": "Modified description"
                },
                {
                    "offerId": "TIM_NEXT_TFOM-5280",
                    "offerDescription": "TIM_NEXT_TFOM-5280"
                },
                {
                    "offerId": "Prod132_TFOM-5425",
                    "offerDescription": "Prod132_TFOM-5425"
                },
                {
                    "offerId": "Prod133_TFOM-5425",
                    "offerDescription": "Prod133_TFOM-5425"
                },
                {},
                {
                    "offerId": "CS2_TFOM-5164",
                    "offerDescription": "CS2_TFOM-5164"
                },
                {
                    "offerId": "OFFERTA_MOBILE_BASE_TFOM-5280",
                    "offerDescription": "OFFERTA_MOBILE_BASE_TFOM-5280"
                },
                {
                    "offerId": "TESTIMPORT_PRODUCT7_TFOM-5280",
                    "offerDescription": "TESTIMPORT_PRODUCT7_TFOM-5280"
                },
                {
                    "offerId": "RT577-TIM_NEXT_E_2GB_LTE_A_209E_(RESTITUZIONE_A_12M)_TFOM-5280",
                    "offerDescription": "RT577-TIM_NEXT_E_2GB_LTE_A_209E_(RESTITUZIONE_A_12M)_TFOM-5280"
                },
                {
                    "offerId": "TESTIMPORT_PRODUCT8_TFOM-5280",
                    "offerDescription": "TESTIMPORT_PRODUCT8_TFOM-5280"
                },
                {
                    "offerId": "Prod131_TFOM-5425",
                    "offerDescription": "Prod131_TFOM-5425"
                },
                {
                    "offerId": "Prod108_TFOM-5410",
                    "offerDescription": "Prod108_TFOM-5410"
                },
                {
                    "offerId": "OPE_Prod_A",
                    "offerDescription": "OPE_Prod_A"
                },
                {
                    "offerId": "PROD_A1",
                    "offerDescription": ""
                },
                {
                    "offerId": "Prod21_TFOM-5375",
                    "offerDescription": "Prod21_TFOM-5375"
                },
                {},
                {
                    "offerId": "OFFER_MOBILE_BASE_TFOM-5280",
                    "offerDescription": "OFFER_MOBILE_BASE_TFOM-5280"
                },
                {
                    "offerId": "SMARTPHONE_TFOM-5280",
                    "offerDescription": "SMARTPHONE_TFOM-5280"
                },
                {
                    "offerId": "TESTIMPORT_PRODUCT6_TFOM-5280",
                    "offerDescription": "TESTIMPORT_PRODUCT6_TFOM-5280"
                },
                {
                    "offerId": "TESTIMPORT_PRODUCT1_TFOM-5280",
                    "offerDescription": "TESTIMPORT_PRODUCT1, TEST COMMA_TFOM-5280"
                },
                {
                    "offerId": "SERVIZIO_MOBILE_PP_TFOM-5280",
                    "offerDescription": "SERVIZIO_MOBILE_PP_TFOM-5280"
                },
                {
                    "offerId": "UC4_G1_TFOM-5280",
                    "offerDescription": "UC4_G1_TFOM-5280"
                },
                {
                    "offerId": "UC1_P1_TFOM-5280",
                    "offerDescription": "P1_TFOM-5280"
                },
                {
                    "offerId": "TESTIMPORT_PRODUCT3_TFOM-5280",
                    "offerDescription": "TESTIMPORT_PRODUCT3_TFOM-5280"
                },
                {
                    "offerId": "TESTIMPORT_PRODUCT4_TFOM-5280",
                    "offerDescription": "TESTIMPORT_PRODUCT4_TFOM-5280"
                },
                {
                    "offerId": "UC1_G1_TFOM-5280",
                    "offerDescription": "G1_TFOM-5280"
                }
            ]
        },
        "segmentAggregations": {
            "currentTotal": 3,
            "otherTotal": 0,
            "types": [
                {
                    "type": "SUB_BRAND",
                    "currentTotal": 3,
                    "otherTotal": 0,
                    "names": [
                        {
                            "currentTotal": 2,
                            "otherTotal": 0,
                            "name": "SP"
                        },
                        {
                            "currentTotal": 1,
                            "otherTotal": 0,
                            "name": "LOOP"
                        }
                    ]
                }
            ]
        },
        "categoryAggregations": {
            "currentTotal": 0,
            "otherTotal": 0,
            "categories": []
        },
        "offerClasses": {
            "currentTotal": 0,
            "otherTotal": 0,
            "id": null,
            "types": []
        },
        "filterAggregations": {
            "total": 0,
            "filterAggregations": []
        },
        "global": {
            "segmentAggregations": null,
            "categoryAggregations": null,
            "recordClassAggregations": null
        }
    }
    
    To browse specific segment with count - The search API gets the total number of products available for a segment name and type with optionally returning those products. This use case supports only single segment name/type search element to see the count. In case multiple segment names/types are present in the request, the count is shown for each segment name and type and the search result yields a union of all segments This is enabled by turning the request attribute "aggregate=true" as in the following request sample:
    {
    	"aggAllCategories":"false",
    	"aggAllSegments":"false",
    	"searchOfferQuery" : {
    		"aggregate" : "true",
    		"globalAggregate" : "false",
    		"segments" : [
    			{
    				"id": "test2",
    				"type": "SUB_BRAND",
    				"names": ["LOOP","SP"]
    			}
    		]
    		
    	}
    }
    
    
    Response
    {
        "totalHits": 2,
        "offers": {
            "offer": [
                {
                    "offerId": "UC1_G2_TFOM-5280",
                    "offerDescription": "Modified description"
                },
                {
                    "offerId": "UC1_G1_TFOM-5280",
                    "offerDescription": "G1_TFOM-5280"
                }
            ]
        },
        "segmentAggregations": {
            "currentTotal": 3,
            "otherTotal": 0,
            "types": [
                {
                    "type": "SUB_BRAND",
                    "currentTotal": 3,
                    "otherTotal": 0,
                    "names": [
                        {
                            "currentTotal": 1,
                            "otherTotal": 0,
                            "name": "LOOP"
                        },
                        {
                            "currentTotal": 2,
                            "otherTotal": 0,
                            "name": "SP"
                        }
                    ]
                }
            ]
        },
        "categoryAggregations": {
            "currentTotal": 0,
            "otherTotal": 0,
            "categories": []
        },
        "offerClasses": {
            "currentTotal": 0,
            "otherTotal": 0,
            "id": null,
            "types": []
        },
        "filterAggregations": {
            "total": 0,
            "filterAggregations": []
        },
        "global": {
            "segmentAggregations": null,
            "categoryAggregations": null,
            "recordClassAggregations": null
        }
    }
    
    Note: Attribute is not part of segment and is not used with them.
    You can browse specific segments along with other segments, and return offers and their count. Additionally it also returns all other segment present in all product models. This is useful particularly in use cases where there is a need to filter by particular segment and also maintain the global context of all segments(modeled in product model) and their counts:
    Request
    {
    	"aggAllCategories":"false",
    	"aggAllSegments":"false",
    	"searchOfferQuery" : {
    		"aggregate" : "true",
    		"globalAggregate" : "true",
    		"segments" : [
    			{
    				"id": "test2",
    				"type": "SUB_BRAND",
    				"names": ["LOOP","SP"]
    			}
    		]
    		
    	}
    }
    
    Response
    {
        "totalHits": 2,
        "offers": {
            "offer": [
                {
                    "offerId": "UC1_G2_TFOM-5280",
                    "offerDescription": "Modified description"
                },
                {
                    "offerId": "UC1_G1_TFOM-5280",
                    "offerDescription": "G1_TFOM-5280"
                }
            ]
        },
        "segmentAggregations": {
            "currentTotal": 3,
            "otherTotal": 0,
            "types": [
                {
                    "type": "SUB_BRAND",
                    "currentTotal": 3,
                    "otherTotal": 0,
                    "names": [
                        {
                            "currentTotal": 1,
                            "otherTotal": 0,
                            "name": "LOOP"
                        },
                        {
                            "currentTotal": 2,
                            "otherTotal": 0,
                            "name": "SP"
                        }
                    ]
                }
            ]
        },
        "categoryAggregations": {
            "currentTotal": 0,
            "otherTotal": 0,
            "categories": []
        },
        "offerClasses": {
            "currentTotal": 0,
            "otherTotal": 0,
            "id": null,
            "types": []
        },
        "filterAggregations": {
            "total": 0,
            "filterAggregations": []
        },
        "global": {
            "segmentAggregations": {
                "currentTotal": 3,
                "otherTotal": 0,
                "types": [
                    {
                        "type": "SUB_BRAND",
                        "currentTotal": 3,
                        "otherTotal": 0,
                        "names": [
                            {
                                "currentTotal": 2,
                                "otherTotal": 0,
                                "name": "SP"
                            },
                            {
                                "currentTotal": 1,
                                "otherTotal": 0,
                                "name": "LOOP"
                            }
                        ]
                    }
                ]
            },
            "categoryAggregations": {
                "currentTotal": 0,
                "otherTotal": 0,
                "categories": []
            },
            "recordClassAggregations": {
                "currentTotal": 0,
                "otherTotal": 0,
                "id": null,
                "types": []
            }
        }
    }