全文检索
顺序扫描法
全文搜索
全文搜索实现原理 1. 建立本库 2. 建立索引 3. 执行搜索 4. 过滤结果
全文搜索实现技术 基于Java的开源实现
lucene
ElasticSearch
Solr
ElasticSearch简介
特点:
分布式
高可用
多类型
多api
面向文档
异步写入
核心概念
近实时
集群
节点
索引
类型
文档
分片
副本
集成
文档类
资源库
测试
设备模型模板
Last updated
Was this helpful?
顺序扫描法
全文搜索
全文搜索实现原理 1. 建立本库 2. 建立索引 3. 执行搜索 4. 过滤结果
全文搜索实现技术 基于Java的开源实现
lucene
ElasticSearch
Solr
ElasticSearch简介
特点:
分布式
高可用
多类型
多api
面向文档
异步写入
核心概念
近实时
集群
节点
索引
类型
文档
分片
副本
集成
文档类
资源库
测试
设备模型模板
Last updated
Was this helpful?
Was this helpful?
compile('org.springframeword.boot:spring-boot-starter-data-elasticsearch')
compile('net.java.dev.jna:jna:4.3.0)spring.data.elasticsearch.cluster-nodes=localhost:9300
spring.data.elasticsearch.properties.transport.tcp.connect-timeout=120s@Document(indexName="blog",type="blog")
public class EsBlog implements Serializable{
private static final long serialVersionUID=lL;
@Id //主键
private String id;
private String title;
private String summary;
private String content;
//Jpa要求,防止直接使用
protected EsBlog(){}
}public class EsBlogRepository implememts ElasticsearchRepository<EsBlog,String>{
//分页查询 去重
page<EsBlog> findDistinctEsBlogByTitleContainingOrSummaryCotainingOrContentContaining(String title,String summary,String )
}@Before
public void initRepositoryData(){
//清除所有数据
esBlogRepository.deleteAll();
esBlogRepository.save(new EsBlog())
}
@Test
public void test(){
Pageable pageable=new PageRequest(0,20);
String title=""
}