> ## 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.

# Retrieve items that are related to a defined item (a document ID)

> This can also be thought of as 'People also viewed...'



## OpenAPI

````yaml /api-reference/4.2/service-recommend.json get /recommend/{collection}/itemsForItem
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}/itemsForItem:
    get:
      tags:
        - 4.2 Recommend API
      summary: Retrieve items that are related to a defined item (a document ID)
      description: This can also be thought of as 'People also viewed...'
      operationId: getItemsForItem
      parameters:
        - name: collection
          in: path
          description: The name of a specific collection
          required: true
          schema:
            type: string
        - name: docId
          in: query
          description: The document ID
          required: false
          schema:
            type: string
        - name: shinglesLimit
          in: query
          description: >-
            The maximum number of shingles (nGrams) to use; the shingles will be
            joined with a boolean OR statement to find the related documents for
            the named item
          required: false
          schema:
            type: integer
            format: int32
            default: 20
        - name: termsLimit
          in: query
          description: >-
            A limit to the number of terms from queries to use in the
            calculation
          required: false
          schema:
            type: integer
            format: int32
            default: 30
        - name: aggrRows
          in: query
          description: The number of rows per aggregation
          required: false
          schema:
            type: integer
            format: int32
            default: 100
        - name: rows
          in: query
          description: The number of items to return
          required: false
          schema:
            type: integer
            format: int32
            default: 10
        - name: aggrType
          in: query
          description: The type of aggregation
          required: false
          schema:
            type: string
            default: '*'
      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

````