学习时间:6小时
代码量:380行(搜索服务)
博客量:1篇
核心学习内容:
Elasticsearch索引设计:
PUT /books
{
  "mappings": {
    "properties": {
      "title": { "type": "text", "analyzer": "ik_max_word" },
      "author": { "type": "keyword" }
    }
  }
}
Spring Data Elasticsearch查询:
java
@Query("{\"match\": {\"title\": \"?0\"}}")
List<Book> findByTitle(String title);
效果对比:
检索方式	10万数据耗时
MySQL LIKE	2.1s
Elasticsearch	0.05s
优化技巧:
使用_reindex API实现零停机索引重建
明日计划:
推荐系统协同过滤算法
Redis缓存用户行为
 
                     
                    
                 
                    
                 
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号