> ## 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 query results

> Send a query to a query pipeline, using the Solr query language and a specific Solr request handler.

The response contains matching documents, plus statistics about the query operation.

Use the `/api/query-pipelines` endpoint to get the query pipeline ID for this request.  For longer parameter lists, use `POST` with this endpoint.  For a Domain Search Language (DSL) search, see the `POST` method for the `/query-pipelines/{id}` endpoint.



## OpenAPI

````yaml /api-reference/5.9/fusion-api-query.json get /query-pipelines/{id}/collections/{collection}/{handler}
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-pipelines/{id}/collections/{collection}/{handler}:
    get:
      tags:
        - Query Pipelines API
      summary: Get query results
      description: >-
        Send a query to a query pipeline, using the Solr query language and a
        specific Solr request handler.


        The response contains matching documents, plus statistics about the
        query operation.


        Use the `/api/query-pipelines` endpoint to get the query pipeline ID for
        this request.  For longer parameter lists, use `POST` with this
        endpoint.  For a Domain Search Language (DSL) search, see the `POST`
        method for the `/query-pipelines/{id}` endpoint.
      operationId: queryUsingGET
      parameters:
        - name: id
          description: The query pipeline ID.
          in: path
          required: true
          schema:
            type: string
          example: default
        - name: collection
          description: The data collection to query.
          in: path
          required: true
          schema:
            type: string
          example: docs
        - name: handler
          description: The Solr search handler to use for this query.
          in: path
          required: true
          schema:
            type: string
        - name: q
          description: The query terms, using the Solr query language.
          in: query
          required: true
          schema:
            type: string
        - name: params
          description: Additional Solr query parameters.
          in: query
          schema:
            $ref: '#/components/schemas/MultiValueMapStringString'
      responses:
        '200':
          description: OK
          content:
            application/*:
              schema:
                $ref: '#/components/schemas/SearchResponse'
            text/*:
              schema:
                $ref: '#/components/schemas/SearchResponse'
      externalDocs:
        description: See the Solr documentation.
        url: >-
          https://solr.apache.org/guide/8_8/requesthandlers-and-searchcomponents-in-solrconfig.html
components:
  schemas:
    MultiValueMapStringString:
      description: The parameters of the query request.
      type: object
      properties:
        all:
          type: object
          additionalProperties:
            type: string
          writeOnly: true
        empty:
          type: boolean
      additionalProperties:
        type: array
        items:
          type: string
    SearchResponse:
      description: The search response.
      type: object
      properties:
        spellcheck:
          $ref: '#/components/schemas/Spellcheck'
        response:
          $ref: '#/components/schemas/Response'
        responseHeader:
          $ref: '#/components/schemas/ResponseHeader'
        facet_counts:
          $ref: '#/components/schemas/FacetCountsCollection'
        facets:
          type: object
          additionalProperties:
            type: object
        stats:
          $ref: '#/components/schemas/Stats'
        grouped:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/GroupsCollection'
        debug:
          type: object
          additionalProperties:
            type: object
        highlighting:
          description: Highlight snippets per matching document, if requested.
          type: object
          additionalProperties:
            type: object
        fusionResponse:
          type: object
          additionalProperties:
            type: object
    Spellcheck:
      description: Spellcheck results.
      type: object
      properties:
        suggestions:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Suggestion'
        correctlySpelled:
          description: '`true` if no misspellings are detected in the query terms.'
          type: boolean
        collations:
          description: Spellcheck collations for this query.
          type: array
          items:
            $ref: '#/components/schemas/Collation'
    Response:
      description: The query result documents and statistics.
      type: object
      properties:
        numFound:
          description: The number of documents matching the query.
          type: integer
          format: int64
        start:
          description: The response start position, for pagination.
          type: integer
          format: int64
        numFoundExact:
          description: >-
            `true` if the `numFound` value is exact.  If `false`, the real
            number of hits for the query is guaranteed to be greater than or
            equal to `numFound`.  You can enable approximate document counts
            using Solr's `minExactCount` parameter.
          type: boolean
        docs:
          description: The set of documents matching the query.
          type: array
          items:
            type: object
            additionalProperties:
              description: The document fields.
              type: object
      example:
        response:
          numFound: 106
          start: 0
          docs:
            - title:
                - Solr and SolrAdmin APIs - Fusion Documentation - Lucidworks
            - title:
                - Solr and SolrAdmin APIs - Fusion Documentation - Lucidworks
            - title:
                - Search Clusters - Fusion Documentation - Lucidworks
            - title:
                - Search Clusters - Fusion Documentation - Lucidworks
            - title:
                - Searching - Fusion Documentation - Lucidworks
        responseHeader:
          status: 0
          QTime: 1
          params:
            fl: title
            lw.pipelineId: default
            q: solr
            wt: json
            rows: '5'
            defType: edismax
    ResponseHeader:
      type: object
      properties:
        zkConnected:
          description: >-
            `true` if the node that processed the request was connected to
            ZooKeeper at the time.
          type: boolean
        QTime:
          description: The request processing time.
          type: integer
          format: int32
        totalTime:
          description: >-
            The sum of all request processing times since the Solr process was
            started.
          type: integer
          format: int32
        params:
          description: The query request parameters.
          type: object
          additionalProperties:
            type: object
        status:
          description: >-
            The request status as an HTTP status code, or `0` for `200`
            (success).
          type: integer
          format: int32
    FacetCountsCollection:
      description: Counts of facets matching the query.
      type: object
      properties:
        facet_fields:
          description: Counts of matching documents per facet field value.
          type: object
          additionalProperties:
            type: object
        facet_queries:
          type: object
          additionalProperties:
            type: object
        facet_ranges:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/FacetRange'
        facet_intervals:
          type: object
          additionalProperties:
            type: object
        facet_heatmaps:
          type: object
          additionalProperties:
            type: object
    Stats:
      type: object
      properties:
        stats_fields:
          type: object
          additionalProperties:
            type: object
    GroupsCollection:
      type: object
      properties:
        numFound:
          type: integer
          format: int64
        groups:
          type: array
          items:
            $ref: '#/components/schemas/Group'
    Suggestion:
      description: A suggested spelling correction for a query term.
      type: object
      properties:
        numFound:
          description: The number of spelling suggestions found for this term.
          type: integer
          format: int32
        startOffset:
          description: The starting offset for pagination.
          type: integer
          format: int32
        endOffset:
          description: The ending offset for pagination.
          type: integer
          format: int32
        origFreq:
          description: >-
            The number of times the original, uncorrected query term appears in
            results.
          type: integer
          format: int32
        suggestion:
          type: array
          items:
            type: object
            properties:
              word:
                description: A suggested spell-corrected word.
                type: string
              freq:
                description: The number of times the suggested word appears in results.
                type: integer
        wordFreqList:
          type: array
          items:
            $ref: '#/components/schemas/WordFreq'
    Collation:
      description: A query correction using collation.
      type: object
      properties:
        collationQuery:
          description: The collated query suggestion.
          type: string
        hits:
          description: The number of documents matching this collated query.
          type: integer
          format: int64
        misspellingsAndCorrections:
          description: The misspelled term and the corrected term.
          type: object
          additionalProperties:
            type: string
    FacetRange:
      description: Range facets are used for fields that contain date or number values.
      type: object
      properties:
        field:
          description: The field that functions as a range facet field.
          type: string
        start:
          description: The start of the facet range.
          type: string
        end:
          description: The end of the facet range.
          type: string
        gap:
          description: The span of the range as a value to be added to the lower bound.
          type: string
        hardEnd:
          description: >-
            A boolean parameter that specifies how Solr handles a range gap that
            cannot be evenly divided between the range start and end values.


            * If `true`, the last range constraint will have the
            `facet.range.end` value an upper bound.


            * If `false`, the last range will have the smallest possible upper
            bound greater then `facet.range.end` such that the range is the
            exact width of the specified range gap. Solr's default value for
            this parameter is `false`.
          type: boolean
        minCount:
          description: >-
            The minimum count required for a range to be included in the
            response.
          type: integer
          format: int32
        include:
          description: >-
            By default, the ranges used to compute range faceting between
            `start` and `end` are inclusive of their lower bounds and exclusive
            of the upper bounds. The "before" range defined with the `other`
            parameter is exclusive and the "after" range is inclusive. This
            default, equivalent to "lower" below, will not result in double
            counting at the boundaries.


            You can use the `include` parameter to modify this behavior using
            the following options:


            * `lower` - All gap-based ranges include their lower bound.


            * `upper` - All gap-based ranges include their upper bound.


            * `edge` - The first and last gap ranges include their edge bounds
            (lower for the first one, upper for the last one) even if the
            corresponding upper/lower option is not specified.


            * `outer` - The "before" and "after" ranges will be inclusive of
            their bounds, even if the first or last ranges already include those
            boundaries.


            * `all` - Includes all options: lower, upper, edge, outer.
          type: array
          items:
            type: string
            enum:
              - lower
              - upper
              - outer
              - edge
              - all
        other:
          description: >-
            This parameter specifies that, in addition to the counts for each
            range constraint between `start` and `end`, counts should also be
            computed for these options:


            * `before` - All records with field values lower then lower bound of
            the first range.


            * `after` - All records with field values greater then the upper
            bound of the last range.


            * `between` - All records with field values between the start and
            end bounds of all ranges.


            * `none` - Do not compute any counts.


            * `all` - Compute counts for before, between, and after.
          type: array
          items:
            type: string
            enum:
              - before
              - after
              - between
              - non
              - all
        domain:
          $ref: '#/components/schemas/FacetDomain'
    Group:
      type: object
      properties:
        field:
          type: string
        leaderStrategy:
          $ref: '#/components/schemas/GroupLeaderStrategy'
        sort:
          type: array
          items:
            $ref: '#/components/schemas/SortElement'
        size:
          type: integer
          format: int64
    WordFreq:
      description: A word and its frequency in the query results.
      type: object
      properties:
        word:
          description: A word.
          type: string
        freq:
          description: The word's frequency.
          type: integer
          format: int32
    FacetDomain:
      type: object
      properties:
        additionalFilters:
          type: array
          items:
            $ref: '#/components/schemas/Query'
        excludedFiltersByName:
          type: array
          items:
            type: string
    GroupLeaderStrategy:
      type: object
      properties:
        type:
          type: string
      discriminator:
        propertyName: type
    SortElement:
      type: object
      properties:
        type:
          type: string
          enum:
            - field
            - expression
            - relevancy
            - query
        value:
          type: string
        order:
          description: The sort order, either ascending (`asc`) or descending (`desc`).
          type: string
          enum:
            - asc
            - desc
        query:
          $ref: '#/components/schemas/Query'
    Query:
      type: object
      properties:
        type:
          type: string
      discriminator:
        propertyName: type
  securitySchemes:
    Basic auth:
      type: http
      scheme: basic
    API key:
      name: x-api-key
      type: apiKey
      in: header

````