Product Selector

Fusion 5.9
    Fusion 5.9

    Set Facets Rule API ConfigurationsManaged Fusion Query Rewrite APIs

    Table of Contents

    This rule type is used in the Query Rewrite API.

    For a complete list of rule and rewrite types in the Query Rewrite API, see Query Rewrite API Configurations.

    For more information, view the API specification.

    Set Facets

    The Set Facets action customizes the facets returned in the query response. These facets are different from the facets set in the Query Workbench.

    For example, an e-commerce website may display different facets on the homepage, the primary search page, and category pages.

    General information

    • Endpoint: https://EXAMPLE_COMPANY.b.lucidworks.cloud/api/apps/APP_NAME/query-rewrite/schema/RULE_TYPE

    • Required parameters are:

      • name

      • type

    • The values for the hints parameter include:

      • hidden: Do not display in the Fusion UI, but can be read and written in the schema.

      • readonly: Cannot be set by the user. If attempted, an error is generated and the operation fails.

    Parameter Schema

    type

    type

    string

    properties

    id

        "id": {
          "type": "string",
          "title": "ID",
          "description": "The ID for this Rule. Used in the API to reference this query rewrite rule. Allowed characters: a-z, A-Z, 0-9, dash (-) and underscore (_)",
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_\\-]+$"
        }

    source

        "source": {
          "type": "string",
          "title": "Source",
          "description": "The source for this query rewrite rule, such as a Spark Job.",
          "hints": [
            "hidden"
          ]
        }

    sourceType

        "sourceType": {
          "type": "string",
          "title": "Source Type",
          "description": "Source type",
          "hints": [
            "hidden"
          ]
        }

    createdOn

        "createdOn": {
          "type": "string",
          "title": "Created Date/Time",
          "description": "Date/Time this rule was created.",
          "format": "date-time"
        }

    updatedOn

        "updatedOn": {
          "type": "string",
          "title": "Updated Date/Time",
          "description": "Date/Time this rule was last updated.",
          "format": "date-time"
        }

    reviewer

        "reviewer": {
          "type": "string",
          "title": "Reviewer",
          "description": "Who reviewed this rewrite rule.",
          "hints": [
            "hidden"
          ]
        },

    reviewedOn

        "reviewedOn": {
          "type": "string",
          "title": "Reviewed Date/Time",
          "description": "Date/Time this rule was last reviewed.",
          "hints": [
            "hidden"
          ],
          "format": "date-time"
        }

    review

        "review": {
          "type": "string",
          "title": "Review",
          "enum": [
            "approved",
            "denied"
          ],
          "default": "approved",
          "hints": [
            "readonly"
          ]
        }

    deployed

        "deployed": {
          "type": "boolean",
          "title": "Deployed Flag",
          "description": "Flag to indicate if this rewrite rule has been deployed.",
          "hints": [
            "hidden"
          ]
        }

    tags

        "tags": {
          "type": "array",
          "title": "Tags",
          "description": "Conditional tags to restrict the triggering of this query rewrite rule.",
          "items": {
            "type": "string"
          }
        }

    name

    Required

        "name": {
          "type": "string",
          "title": "Name",
          "description": "User-friendly name for this rule."
        }

    description

        "description": {
          "type": "string",
          "title": "Description",
          "description": "Short description of what this rule does."
        }

    enabled

        "enabled": {
          "type": "boolean",
          "title": "Enabled",
          "description": "Set to false to disable this rule.",
          "default": true
        }

    matching

        "matching": {
          "type": "string",
          "title": "Match Query Using",
          "description": "Defines how the specified search terms will be compared to the user's query to determine whether this rule applies. 'keywords' means the query must match the keywords of the search terms value exactly. 'phrase' means the search query must contain one of the search terms values as a subphrase. 'text' means that at least one of the search terms values must match the query, but unlike 'phrase', the query only needs to match part of the value.",
          "enum": [
            "keywords",
            "text",
            "phrase"
          ],
          "default": "keywords"
        }

    groups

        "groups": {
          "type": "string",
          "title": "Rule Group",
          "description": "Group for this rule."
        }

    effective_range

        "effective_range": {
          "type": "array",
          "title": "Effective Range",
          "description": "Time range when this rule is in effect.",
          "items": {
            "type": "string"
          }
        }

    priority

        "priority": {
          "type": "integer",
          "title": "Precedence",
          "description": "Used when multiple rules could take effect for a given query - higher number means higher precedence. For example, a rule with precedence of 10 will take effect before a rule with precedence of 3. Ties on precedence are broken based on creation time - the more recently created rule will take effect before the older rule."
        }

    search_terms

        "search_terms": {
          "type": "array",
          "title": "Search Terms",
          "description": "Search terms that trigger this rule.",
          "items": {
            "type": "string"
          }
        }

    filters

        "filters": {
          "type": "array",
          "title": "Filters",
          "description": "Filters used to determine if this rule triggers",
          "items": {
            "type": "object",
            "required": [
              "key",
              "value"
            ],
            "properties": {
              "key": {
                "type": "string",
                "title": "Field Name"
              },
              "value": {
                "type": "string",
                "title": "Field Value"
              }
            }
          }
        }

    response_values

        "response_values": {
          "type": "array",
          "title": "Set Response Values",
          "description": "Key/Value pairs to set in the fusion section of the response.",
          "items": {
            "type": "object",
            "required": [
              "key",
              "value"
            ],
            "properties": {
              "key": {
                "type": "string",
                "title": "Field Name"
              },
              "value": {
                "type": "string",
                "title": "Field Value"
              }
            }
          }
        }

    query_profile_id_ss

        "query_profile_id_ss": {
          "type": "array",
          "title": "Query Profile ID",
          "description": "Query Profile that triggers this rule",
          "items": {
            "type": "string"
          }
        }

    facet_data

    "facet_data": {
          "type": "array",
          "title": "Facet Fields",
          "description": "Field specific facet parameters.",
          "minItems": 1,
          "items": {
            "type": "object",
            "required": [
              "fieldName"
            ],
            "properties": {
              "fieldName": {
                "type": "string",
                "title": "Facet Field",
                "description": "Identifies a field to be treated as a facet."
              },
              "selectType": {
                "type": "string",
                "title": "Select Type",
                "description": "Whether this facet supports single or multiple selections.",
                "enum": [
                  "single",
                  "multi"
                ],
                "default": "multi"
              },
              "type": {
                "type": "string",
                "title": "Facet Type",
                "description": "Either field or range facet.",
                "enum": [
                  "field",
                  "range"
                ],
                "default": "field"
              },
              "sort": {
                "type": "string",
                "title": "Facet Sort",
                "description": "Determines the ordering of the facet field constraints.",
                "enum": [
                  "count",
                  "index"
                ],
                "default": "count"
              },
              "rangeStart": {
                "type": "string",
                "title": "Range Start",
                "description": "Specifies the start of the facet range; required if type is range"
              },
              "rangeEnd": {
                "type": "string",
                "title": "Range End",
                "description": "Specifies the end of the facet range; required if type is range"
              },
              "rangeGap": {
                "type": "string",
                "title": "Range Gap",
                "description": "Specifies the span of the range as a value to be added to the lower bound; required if type is range"
              },
              "minCount": {
                "type": "integer",
                "title": "Min Count",
                "description": "Specifies the minimum counts required for a facet field to be included in the response."
              },
              "boostValues": {
                "type": "array",
                "title": "Boost Values",
                "description": "A list of values to boost, in order you want them included. Only 5 values may be boosted on legacy requests. DSL-requests have no hard limit though performance may degrade if very large numbers of facet-boosts are used.",
                "items": {
                  "type": "string"
                }
              },
              "buryValues": {
                "type": "array",
                "title": "Bury Values",
                "description": "A list of values to bury, in order you want them included.",
                "items": {
                  "type": "string"
                }
              },
              "suppressValues": {
                "type": "array",
                "title": "Suppress Values",
                "description": "A list of values to remove from the results.",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        }

    type

    Required

        "type": {
          "type": "string",
          "title": "Type",
          "enum": [
            "set_facets"
          ],
          "default": "set_facets",
          "hints": [
            "readonly"
          ]
        }

    doc_type

        "doc_type": {
          "type": "string",
          "title": "Doc Type",
          "enum": [
            "rule"
          ],
          "default": "rule",
          "hints": [
            "readonly"
          ]
        }

    display_type

        "display_type": {
          "type": "string",
          "title": "Display Type",
          "enum": [
            "Set Facets"
          ],
          "default": "Set Facets",
          "hints": [
            "readonly"
          ]
        }
      }

    additionalProperties

    additionalProperties

    "additionalProperties": true