搜索引擎ElastaticSearch使用
- 安装:
https://www.elastic.co/downloads/elasticsearch
- 下载安装包后解压
配置elastaticsearch.yml:
# ======================== Elasticsearch Configuration ========================= # # NOTE: Elasticsearch comes with reasonable defaults for most settings. # Before you set out to tweak and tune the configuration, make sure you # understand what are you trying to accomplish and the consequences. # # The primary way of configuring a node is via this file. This template lists # the most important settings you may want to configure for a production cluster. # # Please consult the documentation for further information on configuration options: # https://www.elastic.co/guide/en/elasticsearch/reference/index.html # # ---------------------------------- Cluster ----------------------------------- # # Use a descriptive name for your cluster: # #cluster.name: my-application # # ------------------------------------ Node ------------------------------------ # # Use a descriptive name for the node: # #node.name: node-1 # # Add custom attributes to the node: # #node.attr.rack: r1 # # ----------------------------------- Paths ------------------------------------ # # Path to directory where to store the data (separate multiple locations by comma): # #path.data: /path/to/data # # Path to log files: # #path.logs: /path/to/logs # # ----------------------------------- Memory ----------------------------------- # # Lock the memory on startup: # #bootstrap.memory_lock: true # # Make sure that the heap size is set to about half the memory available # on the system and that the owner of the process is allowed to use this # limit. # # Elasticsearch performs poorly when the system is swapping the memory. # # ---------------------------------- Network ----------------------------------- # # By default Elasticsearch is only accessible on localhost. Set a different # address here to expose this node on the network: # #network.host: 192.168.0.1 # # By default Elasticsearch listens for HTTP traffic on the first free port it # finds starting at 9200. Set a specific HTTP port here: # http.port: 9200 # # For more information, consult the network module documentation. # # --------------------------------- Discovery ---------------------------------- # # Pass an initial list of hosts to perform discovery when this node is started: # The default list of hosts is ["127.0.0.1", "[::1]"] # #discovery.seed_hosts: ["host1", "host2"] # # Bootstrap the cluster using an initial set of master-eligible nodes: # #cluster.initial_master_nodes: ["node-1", "node-2"] # # For more information, consult the discovery and cluster formation module documentation. # # --------------------------------- Readiness ---------------------------------- # # Enable an unauthenticated TCP readiness endpoint on localhost # #readiness.port: 9399 # # ---------------------------------- Various ----------------------------------- # # Allow wildcard deletion of indices: # #action.destructive_requires_name: false http.cors.enabled: true http.cors.allow-origin: "*" #----------------------- BEGIN SECURITY AUTO CONFIGURATION ----------------------- # # The following settings, TLS certificates, and keys have been automatically # generated to configure Elasticsearch security features on 15-07-2022 05:45:57 # # -------------------------------------------------------------------------------- # Enable security features xpack.security.enabled: false xpack.security.enrollment.enabled: true # Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents xpack.security.http.ssl: enabled: true keystore.path: certs/http.p12 # Enable encryption and mutual authentication between cluster nodes xpack.security.transport.ssl: enabled: true verification_mode: certificate keystore.path: certs/transport.p12 truststore.path: certs/transport.p12 # Create a new cluster with the current node only # Additional nodes can still join the cluster later # Allow HTTP API connections from anywhere # Connections are encrypted and require user authentication http.host: 127.0.0.1 # Allow other nodes to join the cluster from anywhere # Connections are encrypted and mutually authenticated #transport.host: 0.0.0.0 #----------------------- END SECURITY AUTO CONFIGURATION ------------------------- action.auto_create_index: .security,.monitoring*,.watches,.triggered_watches,.watcher-history* xpack.graph.enabled: false xpack.ml.enabled: false |
3.进入bin目录下,双击执行elasticsearch.bat
4.看到started说明启动成功,打开浏览器测试一下,如下图
http://localhost:9200
3、安装ElasticSearch-head插件
下载插件
GitHub - mobz/elasticsearch-head: A web front end for an elastic search cluster下载安装包
本地安装node环境,下载安装包解压后执行npm install; npm run start 即可;下载插件时如果插件版本过低可以用如下配置替换:
{ |
启动后访问 127.0.0.1:9100即可;
这个插件是elastaticsearch的图形化操作页面
- springboot集成:
pom文件加入:
<dependency> |
Application.yml 配置es地址及连接:没有设置账号密码,但是可以设置
spring: |
定义实体,映射es上的索引:es上需要建立名为accounts的索引,并插入数据,通过head可视化界面操作即可:
http://localhost:9200/accounts put请求
{
"mappings": {
"properties": {
"user": {
"type": "text"
},
"title": {
"type": "text"=
},
"desc": {
"type": "text"
}
}
}
}
http://localhost:9200/accounts/_doc/ post请求
{"user":"123","title":"123","desc":"123"}
@Data @Field(type = FieldType.Text) @Field(type = FieldType.Text,analyzer = "ik_max_word") //字段类型,采用中文分词器 @Field(type = FieldType.Text) |
Service方法,实现es查询,采用ElasticsearchRestTemplate模板:
public void test() { //根据条件查询 |
搜索引擎ElastaticSearch使用相关推荐
- 电子设计搜索引擎引入分析和见解
电子设计搜索引擎引入分析和见解 Electronics Design Search Engine Introduces Analytics and Insights 2020年上半年最受欢迎的组件是什 ...
- 搜索引擎ElasticSearchV5.4.2系列二之ElasticSearchV5.4.2+kibanaV5.4.2+x-packV5.4.2安装
相关博文: 搜索引擎ElasticSearchV5.4.2系列一之ES介绍 搜索引擎ElasticSearchV5.4.2系列二之ElasticSearchV5.4.2+klanaV5.4.2+x-p ...
- 搜索引擎优化培训教程
很详细的搜索引擎优化培训教材 View more presentations from mysqlops 转载于:https://www.cnblogs.com/macleanoracle/archi ...
- 蜘蛛搜索引擎_各大搜索引擎的蜘蛛特点
我们在做SEO时,需要对各个搜索引擎的爬行蜘蛛有一个很好的了解认知,才能更好的去做好SEO优化,就如你要去谈业务,各大客户的一些身份信息需要了解一样. 下面每日学点SEO就给大家整理了各大搜索引擎蜘蛛 ...
- php常用的搜索引擎,常用搜索引擎高级命令有哪些
一些常用的高级搜索引擎命令,包括以下: 1.Site 这个是最常见的高级搜索命令,作用是查询网站的收录情况,并且这个命令在所有的搜索引擎里是通用的.用法:site:www.aizhan.com 2.D ...
- 百度搜索引擎广告SEM调用架构示意图
下面是从百度计算广告学教程的一份ppt中摘取的几张图片,它们清晰地给出了搜索引擎广告的投放流程,以便参考. 参考文献 [1].百度搜索广告系统工程架构.ppt
- 搜索引擎技术之概要预览
搜索引擎技术之概要预览 前言 近些天在学校静心复习功课与梳理思路(找工作的事情暂缓),趁闲暇之际,常看有关搜索引擎相关技术类的文章,接触到不少此前未曾触碰到的诸多概念与技术,如爬虫,网页抓取,分词,索 ...
- 搜索引擎中的URL散列
散列(hash)也就是哈希,是信息存储和查询所用的一项基本技术.在搜索引擎中网络爬虫在抓取网页时为了对网页进行有效地排重必须对URL进行散列,这样才能快速地排除已经抓取过的网页.最理想的状态是对联网上 ...
- ASP.NET 制作让搜索引擎可以友好访问的链接
作者:http://www.donews.net/lealting/archive/2004/03/31/9759.aspx 今天看了一篇文章,主要是讲,如何制作让搜索引擎可以友好访问的链接,大概的内 ...
最新文章
- 【go】sdk + idea-plugin 开发工具安装
- 327 - Evaluating Simple C Expressions
- 函数调用的参数太少c语言,调用input_message的参数太少在主函数中 是神马意思 大神们帮帮我...
- keepalived安装与配置_Nginx_Keepalived高可用配置
- mysql行级锁升级_mysql innodb 行级锁升级
- 接口测试人员需要掌握的知识技能
- 通才还是专才——由摩托裁员引发的讨论
- 从别的网站摘抄的,挺有用的
- Databinding在自定义ViewGroup中如何绑定view
- 系统虚拟化与虚拟机的区别
- 海康ps流转换h264流
- FFMPEG实现RTSP中H264数据流解码 并且实时播放
- 共享图书横空出世一本书看十天只需一块钱
- kubernetes lowB安装方式
- 急!程序员夫妻结婚了,婚戒上刻什么字好?
- vyos-vyatta在ospf和bgp之间路由重发布使用 打tag形式进行路由过滤
- 深度linux安装宝塔,Linux 安装宝塔
- 啥子是volatile
- WIN10, USB转TTL驱动安装( CH340 和 PL- 2303 )
- 深度linux禁用独立显卡,deepin显卡设置
热门文章
- 动手学习深度学习-环境配置
- 奥威BI,适合中国电商的大数据分析平台
- 用python画apc图_Python开发GUI实战:图片转换素描画工具!
- 数学建模——公式编辑技巧
- 【教程】摆脱UART,仅用JLink也能实现printf功能!! /*更新scanf*/
- 2.【Sharding-JDBC】快速入门
- python 中的continue、else和break区别
- OSVR头部追踪数据格式及VRPN数据处理流程
- 【对比学习】CUT模型论文解读与NCE loss代码解析
- 电子计算机月初美妙的交响,江苏版二年级下学期语文期中测试试卷(8页)-原创力文档...