### File

`src/core/domain/dtos/request.dto.ts`

### Description

Request object, which contains query parameters and Elasticsearch query object

### Index

###### Properties

- Optional es_query
- query

### Constructor

`constructor(query: SearchQueryDto, es_query: EsQueryDto)`
Defined in src/core/domain/dtos/request.dto.ts:37

Constructs an object with provided parameters

Parameters :

Name | Type | Optional
query | `SearchQueryDto` | No
es_query | `EsQueryDto` | No

### Properties

Optional es_query
Type : `EsQueryDto`
Decorators : `@IsOptional() @ApiPropertyOptional({type: EsQueryDto, description: 'Elasticsearch query body constructed by pagination mechanism', example: undefined})`
Defined in src/core/domain/dtos/request.dto.ts:37
Elasticsearch query object

query
Type : `SearchQueryDto`
Decorators : `@IsDefined() @IsNotEmpty() @ApiProperty({type: SearchQueryDto, description: 'Actual query with parameters acquired from the request', example: undefined})`
Defined in src/core/domain/dtos/request.dto.ts:26
Query parameters object

    import { ApiExtraModels, ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
    import { IsDefined, IsNotEmpty, IsOptional } from "class-validator";
    import { EsQueryDto } from "./elastic/es-query.dto";
    import { SearchQueryDto } from "./search-q.dto";

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

    /**
     * Request object, which contains query parameters and Elasticsearch query object
     */
    @ApiExtraModels()
    export class RequestDto {
        /**
         * Query parameters object
         */
        @IsDefined()
        @IsNotEmpty()
        @ApiProperty({
            type: SearchQueryDto,
            description: 'Actual query with parameters acquired from the request',
            example: {}
        })
        query: SearchQueryDto;

        /**
         * Elasticsearch query object
         */
        @IsOptional()
        @ApiPropertyOptional({
            type: EsQueryDto,
            description: 'Elasticsearch query body constructed by pagination mechanism',
            example: {},
        })
        es_query?: EsQueryDto;

         /**
          * Constructs an object with provided parameters
          * @param query
          * @param es_query
          */
        constructor(query: SearchQueryDto, es_query: EsQueryDto) {
            this.query = query;
            this.es_query = es_query;
        }
    }

# results matching ""

# No results matching ""