### File

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

### Description

Structure of the document stored and retrieved from Elasticsearch

### Index

###### Properties

- Optional _score
- _source
- Optional sort

### Properties

Optional _score
Type : `number`
Decorators : `@IsOptional() @ApiPropertyOptional({description: 'Relevance score', example: 1.2355})`
Defined in src/core/domain/dtos/elastic/es-hit.dto.ts:45
Hit relevance score

_source
Type : `PaperDto`
Decorators : `@IsNotEmpty() @ApiProperty({description: 'Actual document (paper) stored in Elasticsearch', example: undefined})`
Defined in src/core/domain/dtos/elastic/es-hit.dto.ts:25
Actual document stored in Elasticsearch

Optional sort
Type : `[]`
Decorators : `@IsOptional() @ApiPropertyOptional({description: 'List of objects that represents how the hit was sorted', example: undefined})`
Defined in src/core/domain/dtos/elastic/es-hit.dto.ts:35
List of objects that represents how the hit was sorted

    import { ApiExtraModels, ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
    import { IsNotEmpty, IsOptional } from "class-validator";
    import { PaperDto } from "../paper.dto";

    /**
     * List of allowed properties in this DTO
     */
    const allowedProperties = ['sort', '_source', '_score'];

    /**
     * Structure of the document stored and retrieved from Elasticsearch
     */
    @ApiExtraModels()
    export class EsHitDto {
        /**
         * Actual document stored in Elasticsearch
         */
        @IsNotEmpty()
        @ApiProperty({
            description: 'Actual document (paper) stored in Elasticsearch',
            example: {
                id: 'sssss'
            }
        })
        _source: PaperDto;

        /**
         * List of objects that represents how the hit was sorted
         */
        @IsOptional()
        @ApiPropertyOptional({
            description: 'List of objects that represents how the hit was sorted',
            example: {}
        })
        sort?: [];

        /**
         * Hit relevance score
         */
        @IsOptional()
        @ApiPropertyOptional({
            description: 'Relevance score',
            example: 1.2355
        })
        _score?: number;
    }

# results matching ""

# No results matching ""