elasticsearch使用,版本2.4.5

本文介绍了如何在Mac上安装Elasticsearch,并提供了访问及安装插件的方法。同时,还详细说明了如何在Spring Boot项目中集成Elasticsearch,以便进行高效的数据检索。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

本人使用mac,win不晓得有没有差别

1.下载

https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.4.5/elasticsearch-2.4.5.tar.gz

2.安装

解压,进入到文件下的bin目录  ./elasticsearch  即可启动。

启动之后访问:http://localhost:9200/   显示页面即为启动成功

3.安装插件

一般都会安装一个head插件,方便看数据

插件列表:http://www.searchtech.pro/elasticsearch-plugins   安装方法,自行百度,谷歌大法

 

4.常用的网址命令

查看有多少 Index

http://localhost:9200/_cat/indices?v

head查看,方便

http://localhost:9200/_plugin/head/

查看index里面属性类型

http://localhost:9200/_mapping?pretty=true

5.springboot集成

导入相应maven,公司自己封装的,等我找到在贴

spring.data.elasticsearch.cluster-name=dev (这个一定要和els目录下config 那个yml文件 cluster-name一致) spring.data.elasticsearch.cluster-nodes=127.0.0.1:9300

 

为什么要用这个呢,是因为我们数据库采用的是cassandra,键值对的形式,数据量庞大的查找很困难,然后依靠els的查找方便,直接走起。

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值