基于Elasticsearch搜索引擎的社区问答系统的研究与实现

 2022-06-20 11:06

论文总字数:30482字

摘 要

育儿社区是面向怀孕期间母亲,为她们提供育儿知识及交流平台的专业在线社区。育儿社区分享喜悦、分享经验、分享各种育儿心情,是一款有针对性的垂直社区。然而随着社区用户数量的增加,帖子量不断增长,社区帖子变得多且内容混乱,解决问题的帖子夹杂在普通的聊天水贴中间。很多新加入社区的用户最开始都抱着寻求帮助,试图解决疑问的心态加入社区,但这些用户并不能立刻从已有的帖子里找到答案,只能被迫发帖询问。然而对于老用户,反复见到重复问题贴则会引起反感。出于照顾新用户,同时确保帖子质量的目的,本课题进行了新的仅关于问题问答的垂直社区的设计开发。该社区针对婴幼儿孕育的各个时期进行分块,供有疑问的社区用户提问,其他用户回答。

作为一个主要针对问答的垂直社区,确保问题搜索的高效率是本课题最重要的部分。本课题使用了ElasticSearch进行全文搜索,将用户发过的帖子的正文及标题分词加入索引,提升搜索速度及准确率。同时考虑到大部分用户问题描述并不专业的现实情况,本课题加入了同义词搜索的功能,扩大搜索答案范围。前端页面利用react绘制,后端使用Nginx代理Apache的方式进行部署,并进行负载等方面的配置。用户数据将使用社区旧有数据,界面,社区管理,权限设置等部分将重新开发。

本课题完成了在线社区各部分功能模块的设计、开发及测试。用户在注册、登录后可以进行发帖、评论。部分拥有权限的管理员可以进行用户禁言、删帖等操作。同时,采用代理技术低成本扩大并发量。此外,课题采用ElasticSearch进行帖子搜索,提升搜索效率。本课题提供了育儿社区目前缺少的部分,为用户提供了方便,也为社区的管理提供了方便。相比与其他社区,大大提升了搜索的质量。

关键词:反向代理,cdn,ElasticSearch搜索引擎,react,垂直社区

Abstract

The parenting community is a professional online community which faces to mothers during the pregnancy, providing them with childcare knowledge and a communication platform. Mothers could share their happiness, experience, and any other parenting emotion in this targeted vertical community. However, with the increasing of the number of the users, the number of the posts increases too. The posts which help users solve their problems are mixed together with other ordinary chats. Most of the new users join the community to seek for help and solve their problems. However, they couldn’t get their answers from the existing posts immediately, so they have to post new ones. For old users, it is annoyed for them to read duplicate posts repeatedly. In consideration of new users and the quality of the posts, this project develops a new vertical community for the users to ask and answer questions which segments babyhood into various times and allows users asking questions and answering for every part.

As a vertical community that mainly focuses on questions and answers, ensuring the high efficiency of problem is the most important part of this project. This project uses ElasticSearch to conduct full-text search, adding the body of the post that the user sent to the title segmentation to the index to improve the search speed and accuracy. In view of the fact that most of the users couldn’t describe the problem in a professional way, this project also develops a function of synonym search to expand the range of the searching result. Front-end is built by React technology, while back-end server uses Nginx agent Apache for deployment and load configuration. This project reuses the user data provided by the old community, while other parts such as community interfaces, community management and permissions settings are redeveloped.

This project has completed the development and testing of every functional module in various parts of the online community. After registering and logging in, users can post and comment posts. Some users have administrator authority to ban users or delete posts. At the same time, agent technology is used to expand concurrent volume in a low cost way. Besides, this project uses ElasticSearch for the usage of searching posts, which can highly improve the efficiency of searching. This project provides a part that the old community doesn’t have and is convenient for users and community management. Compared with other community, this project sharply reduces searching quality.

KEY WORDS: Reverse proxy, cdn, ElasticSearch, react, vertical community

目录

摘 要 I

Abstract II

第一章 绪论 1

1.1 课题背景 1

1.2 课题概述 1

1.2.1 课题简介 1

1.2.2 课题价值 1

1.3 本文工作及组织架构 1

第二章 基础知识 3

2.1 反向代理 3

2.2 redis 3

2.3 cdn 3

2.4 react 3

2.5 ElasticSearch 4

2.5.1 ElasticSearch集群 4

2.5.2 ElasticSearch倒排索引 4

2.5.3 ElasticSearch相关度排序 4

2.5.4 RESTful接口 4

2.6 章节小节 4

第三章 需求分析 5

3.1 功能需求分析 5

3.2 性能需求分析 8

3.3 章节小节 9

第四章 概要设计 10

4.1 系统架构设计 10

4.2 系统模块结构 11

4.2.1 用户权限功能部分 11

4.2.2 ElasticSearch部分 12

4.2.3 代理部分 12

4.3 数据库设计 14

4.4 本章小节 15

第五章 详细设计 16

5.1 课题开发环境 16

5.1.1 硬件部分 16

5.1.2 软件部分 16

5.2 产生项目 16

5.3 注册登录模块 20

5.4 发帖页面 21

5.5 帖子列表页 21

5.6 用户信息页 24

5.7 帖子内容页 26

5.8 管理员页面 26

5.9 搜索模块 28

5.10 本章小节 29

第六章 软件测试分析 30

6.1 功能测试 30

6.2 性能测试 35

6.3 本章小节 35

第七章 总结与展望 36

7.1 课题总结 36

7.2 课题展望 36

致 谢 37

引用文献(Reference) 38

绪论

课题背景

在育儿社区不断发展的过程中,由于用户量不断增加,相应的,无论是日均发帖量还是总贴数都在不断增长。作为一个以育儿为主题的社区,社区一直致力于解决用户在怀孕前后发生的各种问题。帖子数量的增长理论上对社区的发展具有积极的正面作用,然而,过量的帖子却在用户搜索想了解的问题时带来不必要的麻烦。论坛中排除问题贴之外,还有很大一部分晒孩子,晒日常生活的帖子,甚至部分广告贴或其他毫无意义的水贴。新用户在搜索、解决自己问题时很难在海量的帖子中及时发现与自己问题内容契合或是相近的帖子,经过一段时间的翻看之后便会产生急躁的心理,不管其他搜索结果直接发新帖询问。反之对于老用户来说,大部分问题都是浅显的,多次见到过的,甚至没有必要的,反复阅读会给老用户带来厌烦感。这就导致新老用户之间存在不和谐的部分,增加管理员的负担。无论是从照顾新用户,方便寻找信息的角度,还是从提高社区帖子质量的角度考虑,建立一个能满足新用户搜索访问需求的垂直问答社区都是非常有必要的。

课题概述

课题简介

本课题设计开发一个基于ElasticSearch搜索引擎的垂直问答社区系统。主要针对母亲从怀孕到育婴的各个阶段中产生的问题,为广大用户提供在线的问答平台。用户可以在社区上发帖询问自己遇到的问题,或帮助其他遇到问题的用户解决问题。社区的注册用户可以在社区上完成发帖回帖,用户设置等常见任务,有权限的管理员用户可以额外进行帖子删除、加精华、置顶或对普通用户进行禁言、授予权限等操作。同时,论坛使用代理等负载设置以应对可能存在的高并发请求。在问题搜索方面,社区使用ElasticSearch搜索引擎,在提升搜索速度的同时,加入中文分词器及同义词词典以便用户更加准确、完整地找到自己需求的内容。本人在其中承担的部分为整个社区系统的设计开发,新的数据库的设计,代理的配置以及搜索引擎部分的配置。

课题价值

本课题对原社区不足的部分进行补充,是一个定位明确的垂直社区系统。相较于传统的论坛、社区具有较好的针对性。搭入的ElasticSearch搜索引擎不但能为用户的搜索提供更好的搜索体验,也能为管理员减小管理负担。

本文工作及组织架构

本论文主要分为七章内容,各章节内容安排主要如下:

第一章为绪论部分,主要对问题背景进行介绍,并简单介绍课题任务内容以及课题实现价值,最后介绍各章节的组织结构和文本内容。

第二章为基础知识部分,主要介绍说明本课题开发过程中使用的相关技术,如ElasticSearch等的相关知识内容。

第三章部分为需求分析部分,立足于用户的实际需求,对本课题进行分析,并进行简要功能设计,同时对性能要求进行明确规定。

剩余内容已隐藏,请支付后下载全文,论文总字数:30482字

您需要先支付 80元 才能查看全部内容!立即支付

该课题毕业论文、开题报告、外文翻译、程序设计、图纸设计等资料可联系客服协助查找;