### File

`src/core/domain/dtos/search-q.dto.ts`

### Description

Elasticsearch response DTO

### Index

###### Properties
limit order page query

### Constructor

`constructor(query: string, page: number, limit: number, order: string)`
Defined in src/core/domain/dtos/search-q.dto.ts:58
Constructs an object with provided parameters Parameters :
Name | Type | Optional
query | `string` | No
page | `number` | No
limit | `number` | No
order | `string` | No

### Properties

limit
Type : `number`
Decorators : `@IsOptional() @IsInt() @ApiProperty({description: 'limit', example: 10})`
Defined in src/core/domain/dtos/search-q.dto.ts:47
Limits the number of displayed elements.

order
Type : `string`
Decorators : `@IsOptional() @IsString() @ApiProperty({description: 'order', example: 'asc'})`
Defined in src/core/domain/dtos/search-q.dto.ts:58
Limits the number of displayed elements.

page
Type : `number`
Decorators : `@IsDefined() @IsNotEmpty() @IsInt() @ApiProperty({description: 'page', example: 3})`
Defined in src/core/domain/dtos/search-q.dto.ts:36
Page number to display.

query
Type : `string`
Decorators : `@IsDefined() @IsNotEmpty() @IsString() @ApiProperty({description: 'query', example: 'Particle Accelerator'})`
Defined in src/core/domain/dtos/search-q.dto.ts:24
Given query string to perform the search on.

    import { ApiProperty } from "@nestjs/swagger";
    import { IsDefined, IsIn, IsInt, IsNotEmpty, IsOptional, IsString } from "class-validator";

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

    /**
     * Elasticsearch response DTO
     */
    export class SearchQueryDto {
        /**
         * Given query string to perform the
         * search on.
         */
        @IsDefined()
        @IsNotEmpty()
        @IsString()
        @ApiProperty({
            description: 'query',
            example: 'Particle Accelerator'
        })
        query: string;

        /**
         * Page number to display.
         */
        @IsDefined()
        @IsNotEmpty()
        @IsInt()
        @ApiProperty({
            description: 'page',
            example: 3,
        })
        page: number;

        /**
         * Limits the number of displayed elements.
         */
        @IsOptional()
        @IsInt()
        @ApiProperty({
            description: 'limit',
            example: 10,
        })
        limit: number;

        /**
         * Limits the number of displayed elements.
         */
         @IsOptional()
         @IsString()
         @ApiProperty({
             description: 'order',
             example: 'asc',
         })
         order: string;

         /**
          * Constructs an object with provided parameters
          * @param query
          * @param page
          * @param limit
          * @param order
          */
         constructor(query: string, page: number, limit: number, order: string) {
            this.query = query;
            this.page = page;
            this.limit = limit;
            this.order = order;
         }
    }

# results matching ""

# No results matching ""