{"id":20837421,"url":"https://github.com/xdwangwei/elasticsearch-jd","last_synced_at":"2025-05-08T19:53:24.085Z","repository":{"id":37117602,"uuid":"278570125","full_name":"xdwangwei/ElasticSearch-JD","owner":"xdwangwei","description":"最简单的ElasticSearch入门练手项目，前后端分离，SpringBoot+ElasticSearch+Vue仿京东搜索，并高亮关键字显示，适合刚学习ES的小伙伴们~~~","archived":false,"fork":false,"pushed_at":"2022-09-01T23:29:39.000Z","size":1544,"stargazers_count":17,"open_issues_count":2,"forks_count":8,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-31T17:58:44.358Z","etag":null,"topics":["elasticsearch","java","jsoup","springboot","vue"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xdwangwei.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-10T07:37:06.000Z","updated_at":"2025-02-04T04:34:28.000Z","dependencies_parsed_at":"2022-09-17T15:00:41.691Z","dependency_job_id":null,"html_url":"https://github.com/xdwangwei/ElasticSearch-JD","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xdwangwei%2FElasticSearch-JD","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xdwangwei%2FElasticSearch-JD/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xdwangwei%2FElasticSearch-JD/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xdwangwei%2FElasticSearch-JD/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xdwangwei","download_url":"https://codeload.github.com/xdwangwei/ElasticSearch-JD/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253141418,"owners_count":21860538,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elasticsearch","java","jsoup","springboot","vue"],"created_at":"2024-11-18T01:07:29.295Z","updated_at":"2025-05-08T19:53:24.046Z","avatar_url":"https://github.com/xdwangwei.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"### ElasticSearch入门，仿京东搜索实战\n\n#### 项目介绍\n\n此项目是跟随[狂神ES课程](https://www.bilibili.com/video/BV17a4y1x7zq?t=85\u0026p=12)入门所做的SpringBoot+ES+Vue实战项目，在视频的基础上，已实现**前后端分离**。功能比较简单，实现的基本的**爬取+储存+搜索+高亮**，未实现分页，若对ES已有一定的基础，可自己改进，也可发起PR，若发现问题，望及时提醒。\n\n此项目涉及以下功能\n\n- ES创建索引\n- ES删除索引\n- ES批量插入文档\n- ES查询并高亮显示\n- 最基础的JAVA爬虫（Jsoup）\n- Vue基本操作\n\n#### 运行环境\n\n- [ElasticSearch 7.8.0](https://www.elastic.co/guide/en/elasticsearch/reference/current/elasticsearch-intro.html) \n- [kibana 7.8.0](https://www.elastic.co/cn/downloads/kibana)\n- [IK分词器 7.8.0](https://github.com/medcl/elasticsearch-analysis-ik)（可选）\n- IDEA 2020.1.3\n- Maven 3.6.9\n- SpringBoot 2.3.1\n\n#### 前期准备\n\n- 安装ElasticSearch、Kibana、ik分词器，注意这三个**版本必须保持一致**！\n- 启动ElasticSearch，端口 9200，9300\n\n#### 最终效果\n\n同时支持中文搜索、英文搜索\n\n![1](E:\\workspace\\git\\project\\ES-JD\\images\\1.png)\n\n![1](E:\\workspace\\git\\project\\ES-JD\\images\\2.png)\n\n#### 注意事项\n\n- 由于前后端分离，`Controller`上记得加注解```@CrossOrigin(allowedHeaders = \"*\")```允许跨域。\n- 安装`IK`分词器是为了解决中文查询时，默认分词器会将关键词其分割，导致查询不出结果。\n\n- 此页面是我在京东搜索原网页的基础上删减得到的，所以可能有些多余的标签，可以自己试着改，由于我对前端不太熟悉，所以并未有太多的删减。\n\n- 若`Jsoup`解析网页出错或未获取到数据，最好打开浏览器开发者模式，通过检查元素查看标签结构，在控制台用`JS`操作先试试能否获取到结果，若发现与代码中涉及的标签和属性等不一致，请自己修改。\n\n- 京东页面所用的`css`、`js`包括一些图片都是异步加载的，其中涉及到的`css`和`js`我自己下载好了，京东logo和购物车图标的显示也是`http`请求获取到的，不是本地图标，这里我没改是因为我用的VSCode，装了插件LiveServer，所以能够正常显示，所以你能看到我的浏览器地址是 localhost:52330/itemlist.htm，而不是本地协议。\n\n- 使用file协议也可正常运行，也就是直接选择用浏览器打开itemlist.htm，功能不受影响，只不过可能就看不到logo，大概像这样。\n\n  ![1](E:\\workspace\\git\\project\\ES-JD\\images\\3.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxdwangwei%2Felasticsearch-jd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxdwangwei%2Felasticsearch-jd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxdwangwei%2Felasticsearch-jd/lists"}