Type Alias BatchObject

BatchObject: {
    details: {
        deletedDocuments?: number;
        indexedDocuments?: number;
        receivedDocuments?: number;
    };
    duration: string;
    finishedAt: string;
    progress: | null
    | {
        percentage: number;
        steps: { currentStep: string; finished: number; total: number }[];
    };
    startedAt: string;
    stats: {
        indexUids: Record<string, number>;
        status: {
            canceled: number;
            enqueued: number;
            failed: number;
            processing: number;
            succeeded: number;
        };
        totalNbTasks: number;
        types: Record<TaskTypes, number>;
    };
    uid: number;
}

Represents a batch operation object containing information about tasks processing

Type declaration

  • details: {
        deletedDocuments?: number;
        indexedDocuments?: number;
        receivedDocuments?: number;
    }

    Details about document processing

    • OptionaldeletedDocuments?: number

      Number of documents deleted in the batch

    • OptionalindexedDocuments?: number

      Number of documents successfully indexed

    • OptionalreceivedDocuments?: number

      Number of documents received in the batch

  • duration: string

    Duration of batch processing

  • finishedAt: string

    Timestamp when the batch finished processing (rfc3339 format)

  • progress:
        | null
        | {
            percentage: number;
            steps: { currentStep: string; finished: number; total: number }[];
        }

    Progress and indexing step of the batch, null if the batch is finished

  • startedAt: string

    Timestamp when the batch started processing (rfc3339 format)

  • stats: {
        indexUids: Record<string, number>;
        status: {
            canceled: number;
            enqueued: number;
            failed: number;
            processing: number;
            succeeded: number;
        };
        totalNbTasks: number;
        types: Record<TaskTypes, number>;
    }

    Statistics about tasks within the batch

    • indexUids: Record<string, number>

      Count of tasks by index UID

    • status: {
          canceled: number;
          enqueued: number;
          failed: number;
          processing: number;
          succeeded: number;
      }

      Count of tasks in each status

      • canceled: number

        Number of canceled tasks

      • enqueued: number

        Number of tasks waiting to be processed

      • failed: number

        Number of failed tasks

      • processing: number

        Number of tasks currently processing

      • succeeded: number

        Number of successfully completed tasks

    • totalNbTasks: number

      Total number of tasks in the batch

    • types: Record<TaskTypes, number>

      Count of tasks by type

  • uid: number

    Unique identifier for the batch