当前位置: 首页 > news >正文

做系统正版win10系统下载网站网站建设找客户

做系统正版win10系统下载网站,网站建设找客户,顶升网架公司,扬州门户网站开发场景 若依前后端分离版手把手教你本地搭建环境并运行项目#xff1a; 若依前后端分离版手把手教你本地搭建环境并运行项目_本地运行若依前后端分离-CSDN博客 参考上面搭建项目。 ElaticSearch Elasticsearch 是java开发的#xff0c;基于 Lucene 的搜索引擎。它提供了一…场景 若依前后端分离版手把手教你本地搭建环境并运行项目 若依前后端分离版手把手教你本地搭建环境并运行项目_本地运行若依前后端分离-CSDN博客 参考上面搭建项目。 ElaticSearch Elasticsearch 是java开发的基于 Lucene 的搜索引擎。它提供了一个分布式多用户能力的全文搜索引擎基于RESTful Web接口。 Elasticsearch 可以快速有效地存储搜索和分析大量数据而且在处理半结构化数据即自然语言时特别有用。 ElasticSearch官方文档 Elastic documentation | Elastic 应用集成ElasticSearch的方式有REST Client、Jest、Spring Data、Spring Data Elasticsearch Repositories。 下面将介绍Spring Data Elasticsearch的方式。 注 博客霸道流氓气质-CSDN博客 实现 1、在Windows上实现ElaticSearch下载安装和配置 下载地址 Download Elasticsearch | Elastic 这里是Windows下载对应的包下载之后解压 进入bin下双击elasticsearch.bat可以启动 2、踩坑一这里不要随意下载官网最新的ES的安装包需要与springboot版本以及spring-boot-data-elasticsearch的版本 使用指定的对应关系。 否则在运行时会提示 Elasticsearch exception [typeilleagal_argument_exception,reason request [/test] contains unrecognized parameter: [include_type_name]] 以及其他不可预知的问题。 如何查看SpringBoot版本、SpringBoot-data-elasticsearch版本、ElasticSearch版本的对应关系 Versions :: Spring Data Elasticsearch 这里的SpringBoot版本为2.2.13所以上面下载ES时选择对应的6.8.2的版本 双击上面bat启动后访问默认端口9200出现如下提示则es启动成功 3、为了验证以上ES搭建成功可使用调用接口的方式测试索引的创建与查询 创建索引 使用接口调用工具发送如下PUT请求 http://localhost:9200/user 则会创建名为user的索引 然后再访问如下GET请求则可以查询索引 http://localhost:9200/user ES还支持更多其他的api调用的方式和功能这里不做介绍。 4、 ElasticSearch可视化工具elasticsearch-head的下载与使用 可以借助可视化工具进行对索引等的可视化操作。 GitHub - mobz/elasticsearch-head: A web front end for an elastic search cluster 访问以上地址 按照官网提示步骤运行 git clone git://github.com/mobz/elasticsearch-head.gitcd elasticsearch-headnpm installnpm run start 电脑需要安装node环境 然后访问 http://localhost:9100/ 访问之后需要对ES连接输入上面es的地址即可这里是 http://localhost:9200/ 但是在连接时没有连接成功的提示此时打开控制台发现。 elasticsearch-head在连接Elasticsearch时提示: GET http://localhost:9200/_nodes net::ERR_FAILED Access to XMLHttpRequest at ... from origin ...has been blocked.... 这是因为跨域了。 找到es的配置文件config目录下的elasticsearch.yml 添加如下跨域配置 http.cors.enabled: true http.cors.allow-origin: * http.cors.allow-credentials: true http.cors.allow-headers: Content-Type,Accept,Authorization,x-requested-with 然后重启es服务则再连接显示成功 5、SpringBoot中集成ES 按照上面版本对应关系添加pom依赖 dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-data-elasticsearch/artifactIdversion3.2.2/version/dependency 然后新建配置类用来配置es连接地址等 import org.elasticsearch.client.RestHighLevelClient; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.elasticsearch.client.ClientConfiguration; import org.springframework.data.elasticsearch.client.RestClients; import org.springframework.data.elasticsearch.config.AbstractElasticsearchConfiguration;Configuration public class ElasticConfig extends AbstractElasticsearchConfiguration {OverrideBeanpublic RestHighLevelClient elasticsearchClient() {final ClientConfiguration clientConfiguration ClientConfiguration.builder().connectedTo(127.0.0.1:9200) //这里注意不要加http://.build();return RestClients.create(clientConfiguration).rest();} } 这里注意使用的是官网推荐使用的RestHighLevelClient方式详情见官方文档 Spring Data Elasticsearch - Reference Documentation 注意这里避免踩坑在配置类中配置es的地址时使用ip和端口号的方式127.0.0.1:9200 不要带http:// 编写单元测试测试连接与创建索引。 import org.elasticsearch.client.RequestOptions; import org.elasticsearch.client.RestHighLevelClient; import org.elasticsearch.client.indices.CreateIndexRequest; import org.elasticsearch.client.indices.CreateIndexResponse; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import java.io.IOException;RunWith(SpringRunner.class) SpringBootTest(classes RuoYiApplication.class,webEnvironment SpringBootTest.WebEnvironment.RANDOM_PORT) public class ElasticSearchTest {AutowiredQualifier(elasticsearchClient)public RestHighLevelClient highLevelClient;Testpublic void connecTest() throws IOException {CreateIndexRequest request new CreateIndexRequest(test);CreateIndexResponse response highLevelClient.indices().create(request, RequestOptions.DEFAULT);// 查看是否创建成功System.out.println(response.isAcknowledged());highLevelClient.close();} } 运行单元测试结果
http://www.pierceye.com/news/883290/

相关文章:

  • 广西建设厅培训中心兰州seo网站排名
  • 布吉医院网站建设鞍山市网络销售平台
  • 开发一个网站系统报价wordpress文章摘要
  • 做脚本从网站引流外贸网站建设不可缺少的灵活性
  • 网站开发用linux好吗网站公司网站搭建
  • 网站数据库如何导入全自动引流推广软件app
  • 企业微网站案例响应式模板
  • 网站优化排名如何做网站纯色背景图怎么做
  • 医院网站设计方案长沙企业网站
  • 多页网站模板淘宝官网首页登录账号
  • 建设人员变更是哪个网站网络广告方案怎么写
  • 宠物网站 html模板长春城乡建设部网站首页
  • 电商网站设计线路图景县网站建设
  • 中级建设消防员证书查询网站昆明百度搜索排名优化
  • 网站广告是内容营销吗四川鸿业建设集团网站
  • 企业网站管理系统 aspwordpress幻灯片简码
  • 深圳建设银行官方网站上海搜索引擎优化1
  • 网站备案初审过了网络建站网网络推广
  • 网站在线制作平台搜狗提交入口网址
  • 西宁市建设网站价格低网页制作遮罩
  • 做海淘的网站做海淘的网站有哪些网站建设从零开始视频教程
  • 网站设计咨询电话收录提交大全
  • 内网建设网站聊城seo整站优化报价
  • 网站建设的可行性分析报告国际新闻最新消息2022今天
  • 网站后台上传图片做难吗?想要做个公司网站
  • 电商网站设计思维导图长春关键词推广
  • 站长工具综合查询官网wordpress置顶文章不生效
  • 手机网站 文件上传肥城网站建设公司
  • 网站开发怎么做到前后端网页设计实训报告格式
  • 军队 网站备案安卓手机软件开发平台