> ## 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 recommendations for a query

> The fields document-id and its weight are returned



## OpenAPI

````yaml /api-reference/4.2/service-recommend.json get /recommend/{collection}/itemsForQuery
openapi: 3.0.0
info:
  version: 4.2.6-rc1
  title: Fusion Service recommend
servers:
  - url: /api/apollo/
security: []
tags:
  - name: recommend
paths:
  /recommend/{collection}/itemsForQuery:
    get:
      tags:
        - 4.2 Recommend API
      summary: Get recommendations for a query
      description: The fields document-id and its weight are returned
      operationId: getItemsForQuery
      parameters:
        - name: collection
          in: path
          description: >-
            The name of a specific collection; it must have associated
            <collectionName_signals> and <collectionName_signals_aggr>
            collections
          required: true
          schema:
            type: string
        - name: q
          in: query
          description: The Solr query string
          required: false
          schema:
            type: string
        - name: rows
          in: query
          description: The number of items to return
          required: false
          schema:
            type: integer
            format: int32
            default: 10
        - name: fq
          in: query
          description: >-
            A filter query to limit results; if used, the field name must be
            included along with the value
          required: false
          explode: true
          schema:
            type: array
            items:
              type: string
        - name: aggrRows
          in: query
          description: The number of rows per aggregation
          required: false
          schema:
            type: integer
            format: int32
            default: 100
        - name: aggrType
          in: query
          description: The type of aggregation
          required: false
          schema:
            type: string
            default: '*'
        - name: debug
          in: query
          description: If true, debug information will be returned with the results
          required: false
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecommendationResponseDocumentResult'
components:
  schemas:
    RecommendationResponseDocumentResult:
      type: object
      properties:
        header:
          $ref: '#/components/schemas/ResponseHeader'
        items:
          type: array
          readOnly: true
          items:
            $ref: '#/components/schemas/DocumentResult'
        debugInfo:
          $ref: '#/components/schemas/RecommendationDebugQuery'
    ResponseHeader:
      type: object
      properties:
        queryParams:
          $ref: '#/components/schemas/RecommenderQueryParams'
        totalTime:
          type: integer
          format: int64
    DocumentResult:
      type: object
      properties:
        docId:
          type: string
        weight:
          type: number
          format: double
    RecommendationDebugQuery:
      type: object
      properties:
        aggrTime:
          type: integer
          format: int64
        queryTime:
          type: integer
          format: int64
        solrParams:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
    RecommenderQueryParams:
      type: object
      properties:
        aggrType:
          type: string
          readOnly: true
        modelId:
          type: string
          readOnly: true
        rows:
          type: integer
          format: int32
          readOnly: true
        collection:
          type: string
          readOnly: true
        aggrRows:
          type: integer
          format: int32
          readOnly: true
        q:
          type: string
        fq:
          type: array
          readOnly: true
          items:
            type: string
        docId:
          type: string
          readOnly: true
        userId:
          type: string
          readOnly: true
        debug:
          type: boolean
          readOnly: true
          default: false
        shinglesLimit:
          type: integer
          format: int32
          readOnly: true
        termsLimit:
          type: integer
          format: int32
          readOnly: true
        rollupField:
          type: string
          readOnly: true
        rollupWeightField:
          type: string
          readOnly: true
        rollupWeightStrategy:
          type: string
          readOnly: true
          enum:
            - sum
            - max

````