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

上海做网站开发的公司有哪些wordpress 科技 主题

上海做网站开发的公司有哪些,wordpress 科技 主题,天津港电子商务信息网,集思吧网站怎么做问卷1、ES搜索引擎,高性能的分布式搜索引擎,底层基于Lucene 主要用于应用程序中的搜索系统 日志收集 2、基础概念 3、ES处理流程 5、下载中文分词器 Releases infinilabs/analysis-ik GitHub 6、分词模式 最细粒度拆分、智能分词 7、Elaticsearch配置流程 (1)把文件拖进…1、ES搜索引擎,高性能的分布式搜索引擎,底层基于Lucene 主要用于应用程序中的搜索系统 日志收集 2、基础概念 3、ES处理流程 5、下载中文分词器 Releases · infinilabs/analysis-ik · GitHub 6、分词模式 最细粒度拆分、智能分词 7、Elaticsearch配置流程 (1)把文件拖进去,然后执行 (2)访问Elastic 8、分词器 9、客户端集成的三种方式(第二种用的多) ​​​​​​​ 10、es返回的是对象本身,更新本质是保存的操作 11、statement模式默认值丢失、row模式不会、智能模式 12、Query 复杂查询(用第三个) 13、ES语法 查询所有行跟列 MatchAllQueryBuilder 过滤行 限定符 逻辑 must() and should() or 模糊查询 WildcardQueryBuilder 精确查询 MatchPhraseQueryBuilder 范围判断 between and RangeQueryBuilder,gt、lt、gte 包含 in 分组统计 排序 权重 综合排序 @Testpublic void search(){//查询所有MatchAllQueryBuilder matchAllQueryBuilder = QueryBuilders.matchAllQuery();//分页NativeSearchQuery nativeSearchQuery = new NativeSearchQuery(matchAllQueryBuilder);nativeSearchQuery.setPageable(PageRequest.of(0,100));SearchHitsEsProduct searchHits = elasticsearchRestTemplate.search(nativeSearchQuery, EsProduct.class);ListEsProduct esProducts = searchHits.stream().map(SearchHit::getContent).collect(Collectors.toList());log.info(esProducts.toString());} 14、模糊查询 ? 单个单词* 匹配多个 ​​​​​​​匹配的内容如果是多个中文 多个中文单词匹配在查询字段后面使用.keyword 15、ES使用流程(先部署上去7) (1)导包 dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-data-elasticsearch/artifactId/dependency (2)配置 server:port: 8081 spring:elasticsearch:uris: "http://129.204.151.181:9200"username: ""password: ""connection-timeout: 2s (3)写实体类 package com.smart.community.es.entity;import lombok.Data; import org.springframework.data.annotation.Id; import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.annotations.Field;import java.math.BigDecimal; import java.util.List;/*** @author liuhuitang*/ @Data @Document(indexName = "product_index") public class EsProduct {@Idprivate Long productId;@Field(value = "product_name",analyzer = "ik_smart",searchAnalyzer = "ik_smart")private String productName;@Fieldprivate BigDecimal productPrice;private ListString imageUrls;@Field(value = "shop_name",analyzer = "ik_smart",searchAnalyzer = "ik_smart")private String shopName;private Long shopId;}(4)ProductVo(没用上) package com.smart.community.es.common.vo;import lombok.Data;import java.math.BigDecimal; import java.util.List;/*** @author liuhuitang*/ @Data public class ProductVo {private String productName;private BigDecimal productPrice;private ListString imageUrls;}(5)EsProductDao层 package com.smart.community.es.dao;import com.smart.community.es.entity.EsProduct; import org.springframework.data.elasticsearch.annotations.Query; import org.springframework.stereotype.Repository;/*** 创建数据库* @author liuhuitang*/public interface EsProductDao {@Query("/product_product/product/1")EsProduct save(EsProduct esProduct);EsProduct update(EsProduct esProduct);}package com.smart.community.es.dao.impl;import com.smart.community.es.dao.EsProductDao; import com.smart.community.es.entity.EsProduct; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate; import org.springframework.stereotype.Repository;/*** @author liuhuitang*/ @Repository public class EsProductDaoImpl implements EsProductDao {@Autowiredprivate ElasticsearchRestTemplate restTemplate;@Overridepublic EsProduct save(EsProduct esProduct) {return restTemplate.save(esProduct);}@Overridepublic EsProduct update(EsProduct esProduct) {return null;} }(6)测试 package com.smart.community.es.dao.impl;import cn.hutool.core.util.RandomUtil; import com.smart.community.es.dao.EsProductDao; import com.smart.community.es.entity.EsProduct; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;import java.math.BigDecimal; import java.math.RoundingMode; import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream;import static org.junit.jupiter.api.Assertions.*;@SpringBootTest class EsProductDaoImplTest {@Autowiredprivate EsProductDao productDao;@Autowiredprivate ElasticsearchRestTemplate restTemplate;@Testvoid save() {EsProduct esProduct = new EsProduct();esProduct.setProductId(1L);esProduct.setProductName("测试商品");esProduct.setProductPrice(new BigDecimal("1.00"));esProduct.setShopId(100L);esProduct.setShopName("测试店铺");productDao.save(esProduct);}/*** 生成100条测试数据并保存*/@Testvoid batchSave(){ListEsProduct products = Stream.generate(RandomUtil::randomInt).limit(100).map(id - {EsProduct esProduct = new EsProduct();esProduct.setProductId(Long.valueOf(id));esProduct.setProductName("测试商品" + id);esProduct.setShopName("测试店铺" + id);BigDecimal randomPrice = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100000000.00"));esProduct.setProductPrice(randomPrice.setScale(2, RoundingMode.HALF_UP));esProduct.setShopId(1L);return esProduct;}).collect(Collectors.toList());restTemplate.save(products);}} package com.qf.cloud.es.dao.impl;import com.qf.cloud.es.entity.EsProduct; import lombok.extern.slf4j.Slf4j; import org.elasticsearch.index.query.*; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.data.domain.PageRequest; import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate; import org.springframework.data.elasticsearch.core.SearchHit; import org.springframework.data.elasticsearch.core.SearchHits; import org.springframework.data.elasticsearch.core.query.NativeSearchQuery;import javax.annotation.Resource; import java.util.List; import java.util.stream.Collectors;@SpringBootTest @Slf4j public class ElasticsearchRestTemplateTest {@ResourceElasticsearchRestTemplate elasticsearchRestTemplate;/*** 查询 search* NativeSearchQuery 复杂的查询* 查询所有行跟列* 过滤行 限定符 逻辑 模糊查询 精确查询 范围判断 between and 包含 in* 分组统计* 排序 权重 综合排序* match_all* p* 过滤列*/@Testpublic void search() {MatchAllQueryBuilder matchAllQueryBuilder = QueryBuilders.matchAllQuery();NativeSearchQuery nativeSearchQuery = new NativeSearchQuery(matchAllQueryBuilder);nativeSearchQuery.setPageable(PageRequest.of(1, 100));SearchHitsEsProduct searchHits = elasticsearchRestTemplate.search(nativeSearchQuery, EsProduct.class);ListEsProduct esProducts = searchHits.stream().map(SearchHit::getContent).collect(Collectors.toList());log.info(esProducts.toString());}/*** 返回查询*/@Testpublic void testRangeQueryBuilder() {/*** gt lt = gte = lte* between and*/RangeQueryBuilder rangeQueryBuilder = QueryBuilders.rangeQuery("productId");rangeQueryBuilder.gt(10);NativeSearchQuery nativeSearchQuery = new NativeSearchQuery(rangeQueryBuilder);SearchHitsEsProduct searchHits = elasticsearchRestTemplate.search(nativeSearchQuery, EsProduct.class);ListEsProduct esProducts = searchHits.stream().map(SearchHit::getContent).collect(Collectors.toList());log.info(esProducts.toString());}/*** 通配符* ? 单个单词* * 匹配多个** 匹配的内容的多个中文* 多个中文单词匹配在查询字段后面使用.keyword*//*** 模糊查询*/@Testpublic void testWildcardQuery() {WildcardQueryBuilder wildcardQuery = QueryBuilders.wildcardQuery("product_name.keyword", "*测试*");NativeSearchQuery nativeSearchQuery = new NativeSearchQuery(wildcardQuery);SearchHitsEsProduct searchHits = elasticsearchRestTemplate.search(nativeSearchQuery, EsProduct.class);ListEsProduct esProducts = searchHits.stream().map(SearchHit::getContent).collect(Collectors.toList());log.info(esProducts.toString());}/*** =*/@Testpublic void testMatchPhraseQueryBuilder() {/*** 通配符* ? 单个单词* * 匹配多个** 匹配的内容的多个中文* 多个中文单词匹配在查询字段后面使用.keyword*/MatchPhraseQueryBuilder matchPhraseQueryBuilder = QueryBuilders.matchPhraseQuery("shop_name", "测试");NativeSearchQuery nativeSearchQuery = new NativeSearchQuery(matchPhraseQueryBuilder);SearchHitsEsProduct searchHits = elasticsearchRestTemplate.search(nativeSearchQuery, EsProduct.class);ListEsProduct esProducts = searchHits.stream().map(SearchHit::getContent).collect(Collectors.toList());log.info(esProducts.toString());}/*** 逻辑 and or* p* 查询商品信息以及id小于等于 1* BoolQueryBui
http://www.dnsts.com.cn/news/71501.html

相关文章:

  • 做网站毕业答辩问题1920的网站做字体大小
  • phpcms 生成网站地图成都网站建设选择到访率
  • 做视频赚钱的网站做SEO公司多给网站
  • 网站标签图标代码成都高标建设有限公司官方网站
  • 余姚公司做网站怎么咨询自己的网络服务商
  • 帝国怎么做中英文网站网站开发使用api对seo
  • 电子商务网站开发教程课本例题无备案网站做cdn
  • 株洲做网站的公司wordpress默认注册
  • ps做网站如何广州软件外包
  • 资阳网站建设公司装修设计怎么学
  • 加强局网站建设报告开网络公司主要做什么
  • php网站超市源码网站建设 zzit6
  • 网站的注册和登录界面怎么做举报网站建设情况总结
  • 懒人建站网页开发简历模板
  • 重庆网站建设外包网站开发大概多少钱
  • 手机电影网站怎么做互联网 网站建设
  • 苏州网联盛网站建设上海搬家公司电话价格表
  • 男和男做那个视频网站好淘宝客网站主
  • 隧道建设网站怎么了电厂cms系统是什么
  • 网站做seo外链百度推广怎么使用教程
  • 免费行情网站下载大全seo是什么的简称
  • 手机 网站 模板泰安网络营销网站建设
  • 做一个购物网站需要多久室内设计心得体会500字
  • 在阿里云上建立网站的步骤网站开发字体的引用
  • 常德市做网站联系电话注册新公司需要准备的材料
  • 微盟开店怎么收费新网站 seo
  • 百度做网站哪里可以学google官网浏览器
  • 国外建设短视频网站住建局人员名单
  • 装饰网站建设中国建设银行移动门户网站
  • 广西做网站找谁广东建设局网站首页