-
大小: 281KB文件类型: .zip金币: 2下载: 0 次发布日期: 2021-05-27
- 语言: Python
- 标签: elasticsearc mongodb python django
资源简介
利用mongodb、django、elasticsearch等搭建的小型搜索引擎。数据由scrapy框架爬取存入mongodb中,具体使用方法请移步我的github:https://github.com/Weifanwong/search_engine.git

代码片段和文件信息
from datetime import datetime
from elasticsearch_dsl import DocType Date Nested Booleananalyzer Completion Keyword Text Integer
from elasticsearch_dsl.connections import connections
from elasticsearch_dsl.analysis import CustomAnalyzer
connections.create_connection(hosts=[‘127.0.0.1‘])
class Analyzer(CustomAnalyzer):
def get_analysis_definition(self):
return {}
ik_analyzer = Analyzer(‘ik_max_word‘ filter=[‘lowercase‘])
class ShuimuType(DocType): #
title = Text(analyzer=“ik_max_word“)
content = Text(analyzer=“ik_max_word“)
article_id = Keyword()
origin_url = Keyword()
avatar = Keyword()
author = Keyword()
pub_time = Date()
read_count = Integer()
like_count = Integer()
word_count = Integer()
subjects = Text(analyzer=“ik_max_word“)
comment_count = Integer()
class Index:
name = ‘my-index‘
# doc_type = ‘jianshu‘
# index = “scrapy“
if __name__ == “__main__“:
ShuimuType.init()
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-02-19 10:43 qsinghua\
文件 6148 2018-12-16 19:26 qsinghua\.DS_Store
目录 0 2019-02-20 15:20 qsinghua\.git\
文件 66 2018-12-20 10:59 qsinghua\.gitattributes
文件 17 2019-02-20 15:20 qsinghua\.git\COMMIT_EDITMSG
文件 305 2018-12-20 11:00 qsinghua\.git\config
文件 37 2018-12-20 10:59 qsinghua\.git\desc
文件 100 2019-02-20 15:10 qsinghua\.git\FETCH_HEAD
文件 23 2018-12-20 10:59 qsinghua\.git\HEAD
目录 0 2018-12-23 11:11 qsinghua\.git\hooks\
文件 478 2018-12-20 10:59 qsinghua\.git\hooks\applypatch-msg.sample
文件 896 2018-12-20 10:59 qsinghua\.git\hooks\commit-msg.sample
文件 3327 2018-12-20 10:59 qsinghua\.git\hooks\fsmonitor-watchman.sample
文件 189 2018-12-20 10:59 qsinghua\.git\hooks\post-update.sample
文件 424 2018-12-20 10:59 qsinghua\.git\hooks\pre-applypatch.sample
文件 1638 2018-12-20 10:59 qsinghua\.git\hooks\pre-commit.sample
文件 1348 2018-12-20 10:59 qsinghua\.git\hooks\pre-push.sample
文件 4898 2018-12-20 10:59 qsinghua\.git\hooks\pre-reba
文件 544 2018-12-20 10:59 qsinghua\.git\hooks\pre-receive.sample
文件 1492 2018-12-20 10:59 qsinghua\.git\hooks\prepare-commit-msg.sample
文件 3610 2018-12-20 10:59 qsinghua\.git\hooks\update.sample
文件 6108 2019-02-20 15:20 qsinghua\.git\index
目录 0 2018-12-23 11:11 qsinghua\.git\info\
文件 240 2018-12-20 10:59 qsinghua\.git\info\exclude
目录 0 2018-12-23 11:11 qsinghua\.git\logs\
文件 1093 2019-02-20 15:20 qsinghua\.git\logs\HEAD
目录 0 2018-12-23 11:11 qsinghua\.git\logs\refs\
目录 0 2018-12-23 11:11 qsinghua\.git\logs\refs\heads\
文件 1093 2019-02-20 15:20 qsinghua\.git\logs\refs\heads\master
目录 0 2018-12-23 11:11 qsinghua\.git\logs\refs\remotes\
目录 0 2018-12-23 11:11 qsinghua\.git\logs\refs\remotes\origin\
............此处省略268个文件信息
- 上一篇:HOG_SVM的python实现
- 下一篇:Horland-运维监控系统
相关资源
- 二级考试python试题12套(包括选择题和
- pywin32_python3.6_64位
- python+ selenium教程
- PycURL(Windows7/Win32)Python2.7安装包 P
- 英文原版-Scientific Computing with Python
- 7.图像风格迁移 基于深度学习 pyt
- 基于Python的学生管理系统
- A Byte of Python(简明Python教程)(第
- Python实例174946
- Python 人脸识别
- Python 人事管理系统
- 基于python-flask的个人博客系统
- 计算机视觉应用开发流程
- python 调用sftp断点续传文件
- python socket游戏
- 基于Python爬虫爬取天气预报信息
- python函数编程和讲解
- Python开发的个人博客
- 基于python的三层神经网络模型搭建
- python实现自动操作windows应用
- python人脸识别(opencv)
- python 绘图(方形、线条、圆形)
- python疫情卡UN管控
- python 连连看小游戏源码
- 基于PyQt5的视频播放器设计
- 一个简单的python爬虫
- csv文件行列转换python实现代码
- Python操作Mysql教程手册
- Python Machine Learning Case Studies
- python获取硬件信息
评论
共有 条评论