Skip to content

joewen85/esfilesearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

简介

Elasticsearch 实现文件检索。

搜索客户端

elasticsearch-rest-high-level-client

软件版本

名称 版本
Spring boot 2.0.5
Elasticsearch 6.3.2

运行方法

  1. 启动Elasticsearch

  2. 修改application.properties中的配置:

    elastic.search.host=127.0.0.1
    elastic.search.port=9200
    elastic.search.clusterName=elasticsearch
  3. 启动 运行src/main/java/cn/pan/EsfilesearchApplication.java中的main方法.

    启动时会从 src/main/java/cn/pan/MyApplicationRunner.java中初始化索引,把src/main/resources/files目录下的文件导入es.

    默认索引名为userdoc,类型名file,分片数为3,副本为0.

  4. 访问http://localhost:8080

    首页:

    搜索(src/main/resources/files目录下文件名和内容含有的关键词做测试):

About

file search by elasticsearch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published