Whoosh(Python)在哪里实际存储索引内容? [英] Where does Whoosh (Python) physically store the indexed content?

查看:350
本文介绍了Whoosh(Python)在哪里实际存储索引内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始研究内容索引实现,并看看Whoosh( https:/ /pypi.python.org/pypi/Whoosh/ )。

I am beginning to research on content indexing implementation, and was having a look at Whoosh (https://pypi.python.org/pypi/Whoosh/).

我很想知道Whoosh在哪里物理存储其内容 - 是否使用文件?

I am curious to know where Whoosh stores its content physically - Is it using files?

推荐答案

飞快移动使用可插拔存储系统;如果您使用 create_in( )功能然后a 使用FileStorage()将索引存储在目录中的文件中。

Whoosh uses a pluggable storage system; if you use the create_in() function then a FileStorage() class is used that stores indexes in files in a directory.

请参阅飞快移动快速启动


获得架构后,可以使用 create_in 函数创建索引:

import os.path
from whoosh.index import create_in

if not os.path.exists("index"):
    os.mkdir("index")
ix = create_in("index", schema)

(在较低级别,这将创建一个存储对象以包含索引。存储 object表示将存储索引的媒介。通常这将是 FileStorage ,它将索引存储为目录中的一组文件。)

(At a low level, this creates a Storage object to contain the index. A Storage object represents that medium in which the index will be stored. Usually this will be FileStorage, which stores the index as a set of files in a directory.)

这篇关于Whoosh(Python)在哪里实际存储索引内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆