SpecialistOff.NET / Вопросы / Статьи / Фрагменты кода / Резюме / Метки / Помощь / Файлы
Метки: whoosh python
from whoosh.index import open_dirfrom whoosh.qparser import QueryParser, OrGroupix = open_dir(config['DIR_SEARCH_INDEX'])with ix.searcher() as searcher: og = OrGroup.factory(0.1) query = QueryParser("content", ix.schema, group=og) parser = query.parse(text) response = searcher.search(parser, limit=None)