gpt4 book ai didi

python - Whoosh (Python) 在哪里物理存储索引内容?

转载 作者:行者123 更新时间:2023-11-28 21:18:17 26 4
gpt4 key购买 nike

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

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

最佳答案

Whoosh 使用 pluggable storage system ;如果你使用 create_in() function然后是FileStorage() class用于将索引存储在目录中的文件中。

参见 Whoosh quickstart :

Once you have the schema, you can create an index using the create_in function:

import os.path
from whoosh.index import create_in

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

(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.)

关于python - Whoosh (Python) 在哪里物理存储索引内容?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26955410/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com