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

应用asp做网站求职seo

应用asp做网站,求职seo,广告设计网课,中山企业手机网站建设首先在官网下载elasticsearch8.9版本&#xff0c;以及8.9版本的kibana。 解压&#xff0c;点击es8.9bin目录下的elasticsearch.bat文件启动es 如图所示即为成功。 启动之后打开idea&#xff0c;添加依赖 <dependency><groupId>com.fasterxml.jackson.core</g…

首先在官网下载elasticsearch8.9版本,以及8.9版本的kibana。

解压,点击es8.9bin目录下的elasticsearch.bat文件启动es

如图所示即为成功。 

 启动之后打开idea,添加依赖

        <dependency><groupId>com.fasterxml.jackson.core</groupId><artifactId>jackson-databind</artifactId><version>2.13.2</version></dependency><dependency><groupId>org.glassfish</groupId><artifactId>jakarta.json</artifactId><version>2.0.1</version></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-configuration-processor</artifactId><optional>true</optional></dependency><dependency><groupId>co.elastic.clients</groupId><artifactId>elasticsearch-java</artifactId><version>8.9.0</version></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId><version>2.7.10</version></dependency>

之后配置配置文件

@Configuration
public class ElasticSearchConfig {@Beanpublic ElasticsearchClient elasticsearchClient(){RestClient client = RestClient.builder(new HttpHost("localhost", 9200,"http")).build();ElasticsearchTransport transport = new RestClientTransport(client,new JacksonJsonpMapper());return new ElasticsearchClient(transport);}
}

这时候就已经可以使用了基本使用操作如下代码块


@SpringBootTest
class SpringDataJpaApplicationTests {@Autowiredprivate ElasticsearchClient client;/*创建索引*/@Testvoid test01() throws Exception {//写法比RestHighLevelClient更加简洁CreateIndexResponse indexResponse = client.indices().create(c -> c.index("user"));}//查询数据@Testpublic void queryTest() throws IOException {GetIndexResponse getIndexResponse = client.indices().get(i -> i.index("user"));System.out.println(getIndexResponse);}//判断索引是否存在@Testpublic void existsTest() throws IOException {BooleanResponse booleanResponse = client.indices().exists(e -> e.index("user"));System.out.println(booleanResponse.value());}//删除索引@Testpublic void deleteTest() throws IOException {DeleteIndexResponse deleteIndexResponse = client.indices().delete(d -> d.index("user"));System.out.println(deleteIndexResponse.acknowledged());}//插入document@Testpublic void addDocumentTest() throws IOException {User user = new User(1, "张三","123123123");IndexResponse indexResponse = client.index(i -> i.index("user")//设置id.id("1")//传入user对象.document(user));}//更新document@Testpublic void updateDocumentTest() throws IOException {UpdateResponse<User> updateResponse = client.update(u -> u.index("user").id("1").doc(new User(1,"user2","123132131")), User.class);}//查询document@Testpublic void queryDocumentTest() throws IOException {GetResponse<User> response = client.get(g -> g.index("user").id("1"), User.class);System.out.println(response);System.out.println(response.source());}//删除document@Testpublic void deleteDocumentTest() throws IOException {DeleteResponse response = client.delete(d -> d.index("user").id("1"));System.out.println(response);}//批量插入document@Testpublic void bulkTest() throws IOException {List<User> users=new CopyOnWriteArrayList<>();users.add(new User(1,"张1","1233"));users.add(new User(2,"张2","1234"));users.add(new User(3,"张3","1235"));users.add(new User(4,"张4","1236"));users.add(new User(5,"张5","1237"));List< BulkOperation> bulkOperationCopyOnWriteArrayList =new CopyOnWriteArrayList<>();//遍历插入bulk中users.stream().forEach(u->{bulkOperationCopyOnWriteArrayList.add(BulkOperation.of(o ->o.index(i->i.document(u))));});System.out.println(bulkOperationCopyOnWriteArrayList);BulkResponse response=client.bulk(b->b.index("user").operations(bulkOperationCopyOnWriteArrayList));System.out.println(response);}//查询
/*	@Testpublic void searchTest() throws IOException {SearchResponse<User> search = client.search(s -> s.index("user")//查询name字段包含hello的document(不使用分词器精确查找).query(q -> q.term(t -> t.field("name").value(v -> v.stringValue("hello"))))//分页查询,从第0页开始查询3个document.from(0).size(3)//按age降序排序.sort(f->f.field(o->o.field("age").order(SortOrder.Desc))),User.class);for (Hit<User> hit : search.hits().hits()) {System.out.println(hit.source());}}*/}

http://www.hkea.cn/news/904498/

相关文章:

  • 深圳哪里有做网站的汕头seo排名收费
  • 如何用腾讯云主机做网站株洲发布最新通告
  • 中国建设银行官网站下载信息流广告投放公司
  • 合肥建站平台网络平台推广是干什么
  • 黄冈工程建设标准造价信息网优化工作流程
  • 怎么做服装外贸网站怎么去推广一个产品
  • 和各大网站做视频的工作总结软件推广赚佣金渠道
  • asp.net是做网站的吗企业文化培训
  • 有链接的网站怎么做seochan是什么意思
  • 开发公司 工程管理中存在问题seo人工智能
  • 网站卖给别人后做违法信息seo和点击付费的区别
  • 网站配色 绿色网络推广主要做什么
  • 个人网站制作多少钱公关公司的主要业务
  • 网站底备案号链接代码西安网络推广营销公司
  • 哪个网站开发是按月付费的百度指数是免费的吗
  • asp网站后台管理教程放单平台
  • 做网站毕设任务书网络营销网站建设案例
  • .net 企业网站 模版关键词seo深圳
  • 网站建设优化价格网站seo诊断
  • 网站设计详细设计有没有好用的网站推荐
  • 没有货源可以开网店吗网站更新seo
  • 淄博有做网站的吗百度搜索排名怎么收费
  • wordpress页面添加自定义字段木卢seo教程
  • 长寿网站制作保定seo排名外包
  • 域名和网站一样吗电商运营推广怎么做
  • css个人简介网站怎么做b2b网站免费推广平台
  • 网站建设中企动力上海百度广告投诉电话客服24小时
  • 深圳靠谱的电商公司正版搜索引擎优化
  • 自己如何做团购网站腾讯云建站
  • 怀化招标网站磁力狗bt