### File

`src/core/domain/dtos/es-query.dto.ts`

### Description

Elasticsearch query DTO

### Index

###### Properties
Optional pit query Optional search_after Optional size Optional sort

### Constructor

`constructor()`
Defined in src/core/domain/dtos/es-query.dto.ts:70
Constructs an empty object

### Properties

Optional pit
Type : `EsPit`
Decorators : `@IsOptional() @IsObject() @ApiProperty({description: 'PIT object', example: undefined})`
Defined in src/core/domain/dtos/es-query.dto.ts:48
Object, that stores PIT ID and time alive

query
Type : `EsQuery`
Decorators : `@IsDefined() @IsObject() @ApiProperty({description: 'Search query object passed to Elasticsearch', example: undefined})`
Defined in src/core/domain/dtos/es-query.dto.ts:37
The search query object passed to Elasticsearch

Optional search_after
Type : `[]`
Decorators : `@IsOptional() @IsArray() @ApiProperty({description: '', example: undefined})`
Defined in src/core/domain/dtos/es-query.dto.ts:70
Pagination info

Optional size
Type : `number`
Decorators : `@IsOptional() @IsDefined() @IsNumber() @IsInt() @ApiProperty({description: 'Maximum number of elements returned by Elasticsearch', example: 30})`
Defined in src/core/domain/dtos/es-query.dto.ts:26
Maximum number of elements returned by Elasticsearch

Optional sort
Type : `[]`
Decorators : `@IsOptional() @IsArray() @ApiProperty({description: '', example: undefined})`
Defined in src/core/domain/dtos/es-query.dto.ts:59
Sorting info

    import { ApiProperty } from "@nestjs/swagger";
    import { IsArray, IsDefined, IsInt, IsNotEmpty, IsNumber, IsObject, IsOptional } from "class-validator";
    import { EsPit } from "../interfaces/es-pit.interface";
    import { EsQuery } from "../interfaces/es-query.interface"

    /**
     * List of allowed properties in this DTO
     */
     const allowedProperties = ['size', 'query', 'pit', 'sort'];

     /**
      * Elasticsearch query DTO
      */
     export class EsQueryDto {
         /**
          * Maximum number of elements returned by Elasticsearch
          */
         @IsOptional()
         @IsDefined()
         @IsNumber()
         @IsInt()
         @ApiProperty({
             description: 'Maximum number of elements returned by Elasticsearch',
             example: 30
         })
         size?: number;

         /**
          * The search query object passed to Elasticsearch
          */
         @IsDefined()
         @IsObject()
         @ApiProperty({
             description: 'Search query object passed to Elasticsearch',
             example: {},
         })
         query: EsQuery;

         /**
          * Object, that stores PIT ID and time alive
          */
         @IsOptional()
         @IsObject()
         @ApiProperty({
            description: 'PIT object',
            example: {}
         })
         pit?: EsPit;

         /**
          * Sorting info
          */
         @IsOptional()
         @IsArray()
         @ApiProperty({
            description: '',
            example: []
         })
         sort?: unknown[];

         /**
          * Pagination info
          */
         @IsOptional()
         @IsArray()
         @ApiProperty({
            description: '',
            example: []
         })
         search_after?: unknown[];

         /**
          * Constructs an empty object
          */
         constructor() {
            this.size = 10;
            this.query = undefined;
            this.pit = undefined;
            this.sort = undefined;
            this.search_after = undefined;
         }
     }

# results matching ""

# No results matching ""