### File

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

### Description

Elasticsearch query DTO

### Index

###### Properties

- Optional from
- Optional pit
- query
- Optional search_after
- Optional size
- Optional sort

### Constructor

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

### Properties

Optional from
Type : `number`
Decorators : `@IsOptional() @IsInt() @ApiPropertyOptional({description: 'Offset from the start of the list of hits', example: 5})`
Defined in src/core/domain/dtos/elastic/es-query.dto.ts:25
Offset from the start of the list of hits

Optional pit
Type : `EsPit`
Decorators : `@IsOptional() @IsObject() @ApiPropertyOptional({description: 'PIT object', example: undefined})`
Defined in src/core/domain/dtos/elastic/es-query.dto.ts:58
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/elastic/es-query.dto.ts:47
The search query object passed to Elasticsearch

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

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

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

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

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

     /**
      * Elasticsearch query DTO
      */
     @ApiExtraModels()
     export class EsQueryDto {
       /**
        * Offset from the start of the list of hits
        */
       @IsOptional()
       @IsInt()
       @ApiPropertyOptional({
          description: 'Offset from the start of the list of hits',
          example: 5,
       })
       from?: number;

       /**
        * Maximum number of elements returned by Elasticsearch
        */
        @IsOptional()
        @IsInt()
        @ApiPropertyOptional({
            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()
        @ApiPropertyOptional({
           description: 'PIT object',
           example: {}
        })
        pit?: EsPit;

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

        /**
         * Pagination info
         */
        @IsOptional()
        @IsArray()
        @ApiPropertyOptional({
           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 ""