You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
package com.aurora.mapper ;
// 导入项目内定义的ArticleSearchDTO类, 该类作为Elasticsearch文档的实体映射, 用于搜索结果的传输
import com.aurora.model.dto.ArticleSearchDTO ;
// 导入Spring Data Elasticsearch提供的核心接口ElasticsearchRepository, 它封装了基本的Elasticsearch操作
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository ;
import org.springframework.stereotype.Repository ;
/**
* @author 花未眠
* elasticsearch
*/
// @Repository注解将本接口标识为数据访问层( DAO) 组件, 让Spring能够扫描并管理其实例( 如依赖注入)
// 该注解是@Component的特殊化, 表明其主要职责是与数据库( 此处为Elasticsearch) 交互
@Repository
// 定义ElasticsearchMapper接口, 继承自ElasticsearchRepository接口
// ElasticsearchRepository是Spring Data Elasticsearch提供的基础仓库核心接口, 提供了丰富的CRUD和搜索方法
// 内置了和Elasticsearch交互的基础方法( 比如全文搜索、数据新增/删除到ES索引等)
// 泛型参数说明:
// - ArticleSearchDTO: 指定该Repository管理的实体类型, 即Elasticsearch中文档对应的Java对象, 用于ES搜索的文章数据传输对象( 包含文章标题、内容、标签等用于搜索的字段)
// 该类应使用@Document等注解配置索引映射( 如索引名、类型等)
// - Integer: ( DTO对应数据) 指定实体主键( ID) 的数据类型。在Elasticsearch中, 每个文档都有一个唯一ID, 这里使用Integer类型。
public interface ElasticsearchMapper extends ElasticsearchRepository < ArticleSearchDTO , Integer > { //基于文章搜索模块的数据访问层接口
}