Boost搜索引擎
Nevermore 2022-05-27
# 1.前期环境准备
- 安装g++高版本工具
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo #无效时更新源
1
yum clean all;yum makecache
1
开始安装:
sudo yum install centos-release-scl scl-utils-build scl-utils
1
sudo yum install -y devtoolset-7-gcc devtoolset-7-gcc-c++
1
vim ~/.bash_profile
#添加 scl enable devtoolset-7 bash
1
2
2
source ~/.bash_profile
1
- 安装boost库——需要用到一些函数
sudo yum install -y boost-devel
1
# 建立索引
正排索引:每一个文档都有一个id与之对应。
倒排索引:对文档进行分词,对每个分词记录所有包含该词的文档id。