折腾:
后,此时之前同事已经实现了基本的搜索功能,现在要去合并到本地项目中。
所以先要去运行其处理数据的脚本,把数据从MongoDB导入到SOLR中。
先去安装新增的库:
➜ xx git:(master) ✗ cat Pipfile
[[source]]
#url = "https://pypi.python.org/simple"
url = "https://pypi.tuna.tsinghua.edu.cn/simple"
verify_ssl = true
name = "pypi"
[packages]
flask = "*"
flask-restful = "*"
flask-pymongo = "*"
gunicorn = "*"
flask-cors = "*"
python-dotenv = "*"
gevent = "*"
greenlet = "*"
solrclient = "*"
tqdm = "*"
[dev-packages]
[requires]
python_version = "3.6"
[pipenv]
allow_prereleases = true
➜ x git:(master) ✗ pipenv install
Pipfile.lock (28e8c6) out of date, updating to (d76c9e)…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Updated Pipfile.lock (d76c9e)!
Installing dependencies from Pipfile.lock (d76c9e)…
🐍 ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 25/25 — 00:00:06
To activate this project’s virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
然后再去运行本地solr的server
然后才能运行脚本导入数据
参考:
【记录】Mac本地Solr中新建qa的collection再运行脚本导入数据
然后再去创建solr的collection:
先看看本地情况:
➜ x git:(master) ✗ which solr
/usr/local/bin/solr
➜ x git:(master) ✗ solr status
Found 1 Solr nodes:
Solr process 12925 from /usr/local/Cellar/solr/7.2.1/bin/solr-8983.pid not found.
然后遇到:
【已解决】Mac本地创建solr的collection出错:Failed to determine the port of a local Solr instance, cannot create
然后继续操作:
去运行脚本,很快就导入了数据了:
然后就可以正常调试了: