src/core/domain/dtos/es-hit.dto.ts
Structure of the document stored and retrieved from Elasticsearch
Properties |
Optional _score |
Type : number
|
Decorators :
@IsOptional()
|
Defined in src/core/domain/dtos/es-hit.dto.ts:44
|
Hit relevance score |
_source |
Type : PaperDto
|
Decorators :
@IsNotEmpty()
|
Defined in src/core/domain/dtos/es-hit.dto.ts:24
|
Actual document stored in Elasticsearch |
Optional sort |
Type : []
|
Decorators :
@IsOptional()
|
Defined in src/core/domain/dtos/es-hit.dto.ts:34
|
List of objects that represents how the hit was sorted |
import { ApiProperty } from "@nestjs/swagger";
import { IsArray, IsDefined, IsIn, IsInt, IsNotEmpty, IsOptional, IsString } 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
*/
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()
@ApiProperty({
description: 'List of objects that represents how the hit was sorted',
example: {}
})
sort?: [];
/**
* Hit relevance score
*/
@IsOptional()
@ApiProperty({
description: 'Relevance score',
example: 1.2355
})
_score?: number;
}