> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kibocommerce.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Preview Search Merchandizing Rule

> Preview search results with given SearchMerchandizingRule object



## OpenAPI

````yaml /openapi/openapi_catalog_storefront.json post /commerce/catalog/storefront/searchmerchandizingrules/previewsearchmerchandizingrule
openapi: 3.0.1
info:
  description: |-
    <div id="overview_CATALOG_STOREFRONT">
                <h2>CATALOG STOREFRONT</h2>
                <p>The Catalog Storefront APIs are a collection of resources for managing storefront categories, currencies, price lists, products, and
                    product search. This controls how the products in your catalog are organized and displayed on the
                    storefront. See the
                    <a href="/concept-guides/catalog">Catalog user guides</a>
                    for information about the related features in the Unified Commerce Admin.</p>
                <p>Use the <strong>Currencies</strong> resource to retrieve exchange rates for displaying prices on your storefront.</p>
                <p>Use the <strong>Storefront Categories</strong> resource to view the product category hierarchy as it appears to shoppers
                    who are browsing the storefront. The hierarchy can be returned as a flat list or as a category tree.</p>
                <p>Use the <strong>Pricelists</strong> resource to retrieve the details of a price list. The details may contain a hierarchy
                    of ancestor and/or descendant price lists dependening on your configuration.</p>
                <p>Use the <strong>Storefront Products</strong> resource to manage the shopper product selection process during a visit to
                    the web storefront. You can update product options as shoppers pick and choose their product choices. A
                    shopper cannot add a product to a cart until all of its required options have been selected.</p>
                <p>Use the <strong>Product Search</strong> resource to provide dynamic search results to shoppers as they browse and search
                    for products on the web storefront, and to suggest possible search terms as the shopper enters text. The related <strong>Search Redirect</strong>
                    resource allows you to retrieve any search redirect items.</p>
            </div>
  title: Catalog Storefront
  version: 0.0.1
servers:
  - description: Kibo Base URL
    url: '{baseUrl}/api'
    variables:
      baseUrl:
        default: https://t1000000.sb.usc1.gcp.kibocommerce.com
        description: Base URL
security:
  - bearerAuth: []
paths:
  /commerce/catalog/storefront/searchmerchandizingrules/previewsearchmerchandizingrule:
    post:
      tags:
        - SearchMerchandizingRules
      summary: Preview Search Merchandizing Rule
      description: Preview search results with given SearchMerchandizingRule object
      parameters:
        - description: limits which fields are returned in the response body
          in: query
          name: responseFields
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchMerchandizingRuleParameters'
        description: ''
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MerchandizingRulePreviewResult'
            text/json:
              schema:
                $ref: '#/components/schemas/MerchandizingRulePreviewResult'
            text/plain:
              schema:
                $ref: '#/components/schemas/MerchandizingRulePreviewResult'
          description: OK
components:
  schemas:
    SearchMerchandizingRuleParameters:
      properties:
        categoryCode:
          nullable: true
          type: string
        collapse:
          nullable: true
          type: boolean
        pageSize:
          format: int32
          nullable: true
          type: integer
        personalizationUserId:
          description: "User specific personalization ID.\r\nFor Monetate users (AKA MID), it follows this format 2.x.y, where x and y are integers"
          nullable: true
          type: string
        query:
          nullable: true
          type: string
        searchMerchandizingRule:
          $ref: '#/components/schemas/CatalogRuntimesSearchMerchandizingRule'
        startIndex:
          format: int32
          nullable: true
          type: integer
      type: object
    MerchandizingRulePreviewResult:
      description: >-
        SearchMerchandizingPreview requires Position, IsRanked, IsPinned,
        IsBuried
      type: object
    CatalogRuntimesSearchMerchandizingRule:
      description: Search Merchandizing Rule
      properties:
        auditInfo:
          $ref: '#/components/schemas/AdminUserAuditInfo'
        code:
          description: Unique identifier. Will be generated if not provided.
          maxLength: 50
          minLength: 0
          nullable: true
          type: string
        context:
          $ref: '#/components/schemas/CatalogRuntimesSearchMerchandizingRuleContext'
        description:
          nullable: true
          type: string
        isPersonalizationEnabled:
          type: boolean
        name:
          nullable: true
          type: string
        ruleImpact:
          $ref: '#/components/schemas/SearchMerchandizingRuleImpact'
        tags:
          items:
            type: string
          nullable: true
          type: array
      type: object
    AdminUserAuditInfo:
      properties:
        createBy:
          nullable: true
          type: string
        createDate:
          format: date-time
          nullable: true
          type: string
        updateBy:
          nullable: true
          type: string
        updateDate:
          format: date-time
          nullable: true
          type: string
      type: object
    CatalogRuntimesSearchMerchandizingRuleContext:
      description: SearchMerchandizingRule Condition
      properties:
        condition:
          $ref: '#/components/schemas/CatalogRuntimesSearchMerchandizingRuleCondition'
        endDate:
          description: Defaults to MAXDATE
          format: date-time
          nullable: true
          type: string
        searchType:
          $ref: '#/components/schemas/SearchType'
        startDate:
          description: StartDate
          format: date-time
          nullable: true
          type: string
      type: object
    SearchMerchandizingRuleImpact:
      description: SearchMerchandizingRule Condition
      properties:
        buriedItems:
          items:
            $ref: '#/components/schemas/SearchMerchandizingImpactItem'
          nullable: true
          type: array
        excludedItems:
          items:
            $ref: '#/components/schemas/SearchMerchandizingImpactItem'
          nullable: true
          type: array
        fieldValueBoost:
          $ref: '#/components/schemas/SearchMerchandizingFieldValueBoost'
        filter:
          $ref: '#/components/schemas/SearchMerchandizingFilter'
        rankedItems:
          items:
            $ref: '#/components/schemas/SearchMerchandizingImpactItem'
          nullable: true
          type: array
        sortFields:
          items:
            $ref: '#/components/schemas/SearchMerchandizingSortField'
          nullable: true
          type: array
      type: object
    CatalogRuntimesSearchMerchandizingRuleCondition:
      properties:
        fields:
          items:
            $ref: '#/components/schemas/SearchMerchandizingRuleField'
          nullable: true
          type: array
        terms:
          items:
            type: string
          nullable: true
          type: array
      type: object
    SearchType:
      enum:
        - 1
        - 2
      format: int32
      type: integer
    SearchMerchandizingImpactItem:
      properties:
        isPinned:
          type: boolean
        position:
          format: int32
          type: integer
        productCode:
          nullable: true
          type: string
        sliceValue:
          nullable: true
          type: string
      type: object
    SearchMerchandizingFieldValueBoost:
      properties:
        boostType:
          $ref: '#/components/schemas/SearchMerchandizingBoostType'
        fields:
          items:
            $ref: '#/components/schemas/SearchMerchandizingBoostField'
          nullable: true
          type: array
      type: object
    SearchMerchandizingFilter:
      properties:
        exclusion:
          nullable: true
          type: string
        inclusion:
          nullable: true
          type: string
      type: object
    SearchMerchandizingSortField:
      properties:
        direction:
          nullable: true
          type: string
        propertyName:
          nullable: true
          type: string
      type: object
    SearchMerchandizingRuleField:
      properties:
        name:
          nullable: true
          type: string
        value:
          nullable: true
          type: string
      type: object
    SearchMerchandizingBoostType:
      enum:
        - 1
      format: int32
      type: integer
    SearchMerchandizingBoostField:
      properties:
        fieldName:
          nullable: true
          type: string
        valueExpressions:
          items:
            $ref: '#/components/schemas/SearchMerchandizingBoostValueExpression'
          nullable: true
          type: array
      type: object
    SearchMerchandizingBoostValueExpression:
      properties:
        boostNumber:
          format: int32
          type: integer
        operator:
          nullable: true
          type: string
        value:
          nullable: true
          type: string
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      description: JWT Authorization header using the Bearer scheme.
      scheme: bearer
      type: http

````