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

网站太花哨外贸网站建站要多少钱

网站太花哨,外贸网站建站要多少钱,wordpress个人支付宝,网站建设的网页怎么做一.什么是Easy-Es Easy-Es#xff08;简称EE#xff09;是一款基于ElasticSearch(简称Es)官方提供的RestHighLevelClient打造的ORM开发框架#xff0c;在 RestHighLevelClient 的基础上,只做增强不做改变#xff0c;为简化开发、提高效率而生,您如果有用过Mybatis-Plus(简称…一.什么是Easy-Es Easy-Es简称EE是一款基于ElasticSearch(简称Es)官方提供的RestHighLevelClient打造的ORM开发框架在 RestHighLevelClient 的基础上,只做增强不做改变为简化开发、提高效率而生,您如果有用过Mybatis-Plus(简称MP),那么您基本可以零学习成本直接上手EE,EE是MP的Es平替版,在有些方面甚至比MP更简单,同时也融入了更多Es独有的功能,助力您快速实现各种场景的开发. 二.为什么要使用Easy-Es ‌ EasyEs‌是一个基于 ElasticSearch官方提供的 RestHighLevelClient开发的 ORM框架它的设计理念类似于 Mybatis-Plus旨在简化开发、提高效率。使用EasyEs的主要原因包括 ‌简化操作‌EasyEs让开发者无需掌握复杂的DSL语句MySQLElasticsearch‌提高效率‌对于熟悉Mybatis-Plus‌易于集成‌EasyEs作为一款轻量级的ORM框架对现有工程的影响小几乎无侵入性启动时会自动注入基本的CRUD操作性能基本无损耗使得开发者能够直接面向对象操作提高了开发效率。‌降低成本‌在特定的应用场景下如大型数据的存储和检索EasyEs通过优化存储和索引方式如使用ZSTD压缩功能快照备份S3存储 综上所述使用EasyEs可以显著简化Elasticsearch的操作提高开发效率同时降低数据存储和检索的成本是开发和运维人员值得考虑的选择‌. 三.Spring整合Easy-Es 1.依赖   dependenciesdependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-web/artifactId/dependencydependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-test/artifactIdscopetest/scope/dependency!-- lombok插件依赖 --dependencygroupIdorg.projectlombok/groupIdartifactIdlombok/artifactIdscopeprovided/scope/dependency!-- Easy-Es暂不支持SpringBoot3.X且推荐Elasticsearch版本为7.14.0 --dependencygroupIdcn.easy-es/groupIdartifactIdeasy-es-boot-starter/artifactIdversion1.1.1/versionexclusionsexclusiongroupIdorg.projectlombok/groupIdartifactIdlombok/artifactId/exclusionexclusiongroupIdorg.elasticsearch.client/groupIdartifactIdelasticsearch-rest-high-level-client/artifactId/exclusionexclusiongroupIdorg.elasticsearch/groupIdartifactIdelasticsearch/artifactId/exclusion/exclusions/dependencydependencygroupIdorg.elasticsearch.client/groupIdartifactIdelasticsearch-rest-high-level-client/artifactIdversion7.14.0/version/dependencydependencygroupIdorg.elasticsearch/groupIdartifactIdelasticsearch/artifactIdversion7.14.0/version/dependency /dependencies 2.配置   easy-es:enable: trueaddress : 服务器地址:9200global-config:process_index_mode: manual 3.启动类 SpringBootApplication EsMapperScan(com.easyes.mapper) public class EasyEsApplication {public static void main(String[] args) {SpringApplication.run(EasyEsApplication.class, args);}} 4.mapper public interface DocumentMapper extends BaseEsMapperDocument {} 5.service package com.easyes.service;import com.easyes.entity.Document;import java.util.List;public interface IDocumentService{/*** 查询ES所有数据* return 查询Document结果对象集合*/ListDocument findAllData();/*** 创建索引* return 结果信息* throws Exception*/String createIndex() throws Exception;/*** 删除索引* return 结果信息*/String deleteIndex();/*** ES新增数据* param document 新增数据实体类* return 结果信息* throws Exception*/String addData(Document document) throws Exception;/*** 根据id删除ES数据* param id 需要删除的数据的id* return*/String deleteDataById(String id);/*** 修改ES数据* param document 修改数据对象*/String updateData(Document document);/*** 分词匹配查询content字段* param value 查询内容* return*/ListDocument findMatch(String value);/*** 根据id查询数据* param id 查询id* return*/Document findById(String id); } 6.serviceImpl package com.easyes.service.impl;import cn.easyes.common.utils.StringUtils; import cn.easyes.core.conditions.LambdaEsQueryWrapper; import com.easyes.entity.Document; import com.easyes.mapper.DocumentMapper; import com.easyes.service.IDocumentService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service;import java.util.Date; import java.util.List;Service public class DocumentServiceImpl implements IDocumentService {Autowiredprivate DocumentMapper documentMapper;/*** 查询ES所有数据* return 查询Document结果对象集合*/Overridepublic ListDocument findAllData() {LambdaEsQueryWrapperDocument wrapper new LambdaEsQueryWrapper();wrapper.matchAllQuery();return documentMapper.selectList(wrapper);}/*** 创建索引* return 结果信息* throws Exception*/Overridepublic String createIndex() throws Exception {StringBuilder msg new StringBuilder();String indexName Document.class.getSimpleName().toLowerCase();boolean existsIndex documentMapper.existsIndex(indexName);if (existsIndex){throw new Exception(Document实体对应索引已存在,删除索引接口deleteIndex);}boolean success documentMapper.createIndex();if (success){msg.append(Document索引创建成功);}else {msg.append(索引创建失败);}return msg.toString();}/*** 删除索引* return 结果信息*/Overridepublic String deleteIndex() {StringBuilder msg new StringBuilder();String indexName Document.class.getSimpleName().toLowerCase();if (documentMapper.deleteIndex(indexName)){msg.append(删除成功);}else {msg.append(删除失败);}return msg.toString();}/*** ES新增数据* param document 新增数据实体类* return 结果信息* throws Exception*/Overridepublic String addData(Document document) throws Exception {if (StringUtils.isEmpty(document.getTitle()) || StringUtils.isEmpty(document.getContent())) {throw new Exception(请补全title及content数据);}document.setCreateTime(new Date());documentMapper.insert(document);return Added successfully;}/*** 根据id删除ES数据* param id 需要删除的数据的id* return*/Overridepublic String deleteDataById(String id) {documentMapper.deleteById(id);return Success;}/*** 修改ES数据* param document 修改数据对象*/Overridepublic String updateData(Document document) {documentMapper.updateById(document);return Success;}/*** 分词匹配查询content字段* param value 查询内容* return*/Overridepublic ListDocument findMatch(String value) {LambdaEsQueryWrapperDocument wrapper new LambdaEsQueryWrapper();wrapper.match(Document::getContent,value);wrapper.orderByDesc(Document::getCreateTime);ListDocument documents documentMapper.selectList(wrapper);return documents;}/*** 根据id查询数据* param id* return*/Overridepublic Document findById(String id) {return null;} }7.controller package com.easyes.controller;import com.easyes.entity.Document; import com.easyes.service.IDocumentService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController;import java.util.List;RestController public class DocumentController {Autowiredprivate IDocumentService iDocumentService;/*** 创建索引* return 结果信息* throws Exception*/GetMapping(/createIndex)public String createIndex() throws Exception {return iDocumentService.createIndex();}/*** 删除索引* return 结果信息*/GetMapping(/deleteIndex)public String deleteIndex(){return iDocumentService.deleteIndex();}/*** 查询ES所有数据* return 查询Document结果对象集合*/GetMapping(/findAll)public ListDocument findAll(){return iDocumentService.findAllData();}/*** 根据id查询数据* param id 查询数据的id* return 查询Document结果对象*/GetMapping(/findById)public Document findById(String id){return iDocumentService.findById(id);}/*** ES新增数据* param document 新增数据对象* return 结果信息* throws Exception*/GetMapping(/add)public String addData(RequestBody Document document) throws Exception {return iDocumentService.addData(document);}/*** 修改ES数据* param document 修改数据对象*/GetMapping(/update)public String updateData(RequestBody Document document){return iDocumentService.updateData(document);}/*** 根据id删除ES数据* param id 需要删除的数据的id* return*/GetMapping(/delete)public String deleteData(String id){return iDocumentService.deleteDataById(id);}/*** 分词匹配查询content字段* param value 查询内容* return*/GetMapping(/match)public ListDocument findMatch(String value){return iDocumentService.findMatch(value);} } 实体类注解 // Lombok 注解自动为类生成 getter 和 setter 方法 Data // 指定 Elasticsearch 索引名及分片数 IndexName(value user_es, shardsNum 3) public class User {/*** 用户ID* 使用自定义ID类型*/IndexId(type IdType.CUSTOMIZE)private Integer id;/*** 用户姓名* 字段类型为 TEXT使用 IK 最大词元分词器进行索引和搜索* 在搜索结果中匹配的部分将被高亮显示*/IndexField(value userName, fieldType FieldType.TEXT, analyzer Analyzer.IK_MAX_WORD, searchAnalyzer Analyzer.IK_MAX_WORD)HighLight(preTag span style\color:red\, postTag /span)private String name;/*** 用户年龄* 字段类型为 INTEGER*/IndexField(fieldType FieldType.INTEGER)private Integer age;/*** 用户工资* 字段类型为 DOUBLE*/IndexField(fieldType FieldType.DOUBLE)private BigDecimal salary;/*** 用户生日* 字段类型为 DATE*/IndexField(fieldType FieldType.DATE)private Date birthday; }
http://www.tj-hxxt.cn/news/134216.html

相关文章:

  • 土地流转网站建设报告平台网站建设公司哪家好
  • 坦克大战网站开发课程设计报告网站建设z亿玛酷1订制
  • 一个页面对网站如何建设wordpress可以做电影站
  • 云南省网站建设成都网站制作哪家专业
  • 内蒙古网站制作公司台州建设网站制作
  • 空间商网站腾讯网站建设公司
  • 珠海做公司网站如何做简易的网站
  • 河北省建设工程造价管理协会网站微门户网站建设
  • 公司网站网页制作建议海北网站建设
  • 如何进行网页设计和网站制作网站建设这个职业是什么意思
  • 怀化建设公司网站各大网址收录查询
  • 2017网站建设报价方案做网站的好公司有哪些
  • 宁波北仑做网站阿里云 发布网站 教程
  • 湖南网站开发哪家好深圳高端网站制作费用
  • 网站做程序外贸网站模板源码
  • 网站制作的主要流程网站建设 技术支持
  • 在百度做网站多少钱网站建设服务商城
  • 河南省建设教育协会网站php网站后台上传不了图片
  • 网站建设需要具备哪些做网站分pc端和移动端的吗
  • wordpress设置安全湛江百度seo公司
  • 上海青浦房地产网站建设简历设计网官网
  • 用插件做网站建站公司外贸
  • 现在做一个网站多少钱合肥寒假兼职工网站建设
  • 网站维护源码自适应58同城找工作招聘官网
  • 济南做网站公司哪家好网上虚拟银行注册网站
  • 界面官方网站专业格泰建站
  • 苏州企业网站建设网站域名审核时间
  • 用cn作网站行么海外网站空间
  • 网站监控的软件怎么做响应式网站 尺寸
  • 上海电商网站开发公司一般的网站是由什么语言做的