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

# Get a query rewrite

> Get details for an existing query rewrite.



## OpenAPI

````yaml /api-reference/5.9/fusion-api-query.json get /query-rewrite/instances/{id}
openapi: 3.0.1
info:
  title: Fusion Query API
  description: >-
    A Lucidworks Fusion microservice for machine-learning-enhanced ranking and
    retrieval.
  contact:
    name: Lucidworks
    url: www.lucidworks.com
    email: support@lucidworks.com
  license:
    name: License of API
    url: https://lucidworks.com/legal/developer-license-agreement/
  version: '5.9'
servers:
  - url: https://{FUSION HOST}/api
    description: Fusion
    variables:
      FUSION HOST:
        default: FUSION_HOST
        description: Your environment host.
  - url: https://{FUSION HOST}/api/apps/{APP_NAME}
    description: Fusion app
    variables:
      FUSION HOST:
        default: FUSION_HOST
        description: Your environment host.
      APP_NAME:
        default: APP_NAME
        description: The name of your Fusion app.
security:
  - Basic auth: []
  - API key: []
tags:
  - name: Custom Rule Type API
    description: Endpoints to define and manage custom rule type definitions.
  - name: Experiments API
    description: >-
      Use the Experiments API to compare different configuration variants and
      determine which ones are most successful.
  - name: Query Pipelines API
    description: >-
      Use these endpoints to view and manage your query pipelines.  You can also
      send queries using this API, though the Query Profiles API is recommended
      instead.
  - name: Query Profiles API
    description: >-
      The Query Profiles API provides static endpoints that you can consistently
      point to when querying your collections.  Query profiles allow you to
      change the query pipelines or collections behind them without changing the
      endpoint you use for your search queries.  See the Query Profiles CRUD API
      for endpoints that create and modify query profiles.
  - name: Query Profiles CRUD API
    description: >-
      Use these endpoints to create and modify query profiles.  Query profiles
      allow you to change the query pipelines or collections behind them without
      changing the endpoint you use for your search queries.  See the Query
      Profiles API for the query endpoints.
  - name: Query Rewrite API
    description: >-
      The Query Rewrite API manages documents used for query rewriting to
      improve relevancy using AI-generated data. Primarily for internal use.
  - name: Query Stage API
    description: >-
      Use these endpoints to view the available query pipeline stages and their
      configuration parameters.
  - name: Query Stage Plugins API
    description: >-
      Use these endpoints to view, install, and manage custom query stages
      developed with the Query Stage SDK.
  - name: Signal Indexing API
    description: Endpoints to index signals.
  - name: Experience Manager API
    description: API only for internal use by the Experience Manager Springboard system
  - name: Query Pipeline Template API
    description: Used internally to generate query pipelines from a template.
externalDocs:
  description: Lucidworks Documentation.
  url: https://doc.lucidworks.com/
paths:
  /query-rewrite/instances/{id}:
    get:
      tags:
        - Query Rewrite API
      summary: Get a query rewrite
      description: Get details for an existing query rewrite.
      operationId: getQueryRewrite
      parameters:
        - name: id
          description: The query rewrite ID.
          in: path
          required: true
          schema:
            type: string
        - name: context
          description: >-
            The app to which this object belongs, as `app:SomeApp`. If the app
            doesn't exist, the request fails. Other comma-separated contexts in
            the `context` parameter are allowed but ignored.
          in: query
          required: true
          schema:
            type: string
          example: app:SomeApp
        - name: editSessionId
          description: An edit session ID filter. Equivalent to a Fusion username.
          in: query
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/QueryRewrite'
components:
  schemas:
    QueryRewrite:
      type: object
      discriminator:
        propertyName: type
      required:
        - id
        - type
      properties:
        type:
          anyOf:
            - type: string
              enum:
                - banner
                - block_list
                - boost_attributes
                - boost_list
                - bury_list
                - filter_list
                - ground_truth
                - ingroup_boost_list
                - ingroup_bury_list
                - ingroup_pinned
                - json_blob
                - phrase
                - pinned
                - redirect
                - removeWords
                - response_value
                - set_facets
                - set_params
                - simq
                - spell
                - synonym
                - tail
            - type: string
              description: Custom rule type not in the predefined list
          description: >-
            The type of rule, written in snake case. In the Fusion UI, some of
            these types correspond to the types in the Rewrites Manager and
            others correspond to actions in the Rules Manager.


            * `banner` - A _rule_ that adds an HTML-formatted banner to query
            responses.

            * `block_list` - A _rule_ that blocks values from appearing in query
            results.

            * `boost_attributes` - A _rule_ that boosts documents in query
            results.

            * `boost_list` - A _rule_ that boosts documents with a large
            multiplicative boost.

            * `bury_list` - A _rule_ that buries documents so they are minimized
            but not blocked.

            * `filter_list` - A _rule_ that applies filter queries (`fq`) to
            matching queries.

            * `ground_truth` - A query rewrite that estimates ground truth
            queries using click signals and query signals.

            * `ingroup_boost_list` - A _rule_ that boosts an item within a
            product group.

            * `ingroup_bury_list` - A _rule_ that buries an item within a
            product group.

            * `ingroup_pinned` - A _rule_ that pins a document to a specific
            location within a product group.

            * `json_blob` - A _rule_ that returns an arbitrary JSON blob for
            display outside of the search results.

            * `phrase` - A _query rewrite_ that boosts phrases when they appear
            in queries.

            * `pinned` - A _rule_ that pins a document to a specific location
            within the search results.

            * `redirect` - A _rule_ that adds a redirect message to the query
            response.

            * `removeWords` - A _query rewrite_ that removes phrases from
            queries.

            * `response_value` - A _rule_ that sends an arbitrary value to the
            front end or pipeline.

            * `set_facets` - A _rule_ that customizes the facets returned in the
            query response.

            * `set_params` - A _rule_ that sets a parameter name and value to a
            search query.

            * `simq` - A _query rewrite_ that detects overlap between the
            results of similar queries.

            * `spell` - A _query rewrite_ that maps misspellings to their
            corrected spellings.

            * `synonym` - A _query rewrite_ that maps query terms to their
            synonyms.

            * `tail` - A _query rewrite_ that replaces under-performing queries
            with queries that produce higher click-through rates.
        id:
          type: string
          description: >-
            A unique ID for the query rewrite. Allowed characters: a-z, A-Z,
            0-9, dash (-) and underscore (_)
        source:
          description: The name of the source that made the update, such as a Spark job.
          type: string
        sourceType:
          description: The type of source that made the update.
          type: string
        createdOn:
          type: string
          format: date-time
          description: A timestamp value that describes when the rule was created.
        updatedOn:
          type: string
          format: date-time
          description: 'A timestamp value that describes when the rule was last modified. '
        reviewer:
          type: string
          description: Who reviewed this rewrite rule.
        reviewedOn:
          type: string
          description: Date/Time this rule was last reviewed.
          format: date-time
        review:
          type: string
          enum:
            - auto
            - pending
            - approved
            - denied
            - supplied
          description: The query rewrite's review status.
        deployed:
          type: boolean
          description: >-
            Describes whether the query rewrite is published. 


            When `true`, the query rewrite is published and the latest changes
            are live. When `false`, the latest changes are not live, though
            previous versions may be live.
        tags:
          type: array
          description: >-
            An array of conditional tags that are used to restrict the
            triggering of the query rewrite.
          items:
            type: string
        is_deleted:
          type: boolean
          description: >-
            Describes whether the query rewrite is marked for deletion.


            When `true`, the query rewrite will be deleted when the latest
            changes are published. When `false`, the query rewrite will not be
            deleted when the latest changes are published. 
        base_object_id_s:
          type: string
          description: 'A unique ID for the query rewrite. Matches the value of `id`. '
        doc_type:
          description: Either `query_rewrite` or `rule`.
          type: string
        description:
          description: The rule description.
          type: string
          x-stoplight:
            id: tnuwejztlnl0q
        priority:
          type: integer
          default: 1
          x-stoplight:
            id: 5zbjpoi874rgv
          description: >-
            Specifies the rule’s precedence when multiple rules could apply to
            the same query.


            Higher values indicate higher precedence: the rule with the highest
            precedence is applied last and takes final effect. For example, a
            rule with precedence 3 will override a rule with precedence 2.


            If two rules have the same precedence, the more recently created
            rule takes precedence.
        matching:
          type: string
          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
          x-stoplight:
            id: pn6wn7jaq1b63
        groups:
          type: string
          description: Group for this rule.
          x-stoplight:
            id: igpylzyzzoi7t
        rollup:
          type: string
          x-stoplight:
            id: tjo6xjwc16u3w
  securitySchemes:
    Basic auth:
      type: http
      scheme: basic
    API key:
      name: x-api-key
      type: apiKey
      in: header

````