我开始研究内容索引的实现,并且正在查看 Whoosh (https://pypi.python.org/pypi/Whoosh/ https://pypi.python.org/pypi/Whoosh/).
我很想知道 Whoosh 将其内容物理存储在哪里 - 它使用文件吗?
呼呼使用可插拔存储系统 https://whoosh.readthedocs.io/en/latest/api/filedb/filestore.html#whoosh.filedb.filestore.Storage;如果你使用create_in()功能 https://whoosh.readthedocs.io/en/latest/api/index.html#whoosh.index.create_in then a FileStorage() class https://whoosh.readthedocs.io/en/latest/api/filedb/filestore.html#whoosh.filedb.filestore.FileStorage用于将索引存储在目录中的文件中。
See the 快速入门 https://whoosh.readthedocs.io/en/latest/quickstart.html:
获得架构后,您可以使用以下命令创建索引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)
(在低水平上,这会创建一个Storage
包含索引的对象。 AStorage
object 表示将存储索引的介质。通常这将是FileStorage
,它将索引存储为目录中的一组文件。)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)