summaryrefslogtreecommitdiff
path: root/src/index_search.py
blob: 805a9fb18197315d5235fbfefda49e31f2e0c048 (plain)
1
2
3
4
5
6
7
8
9
10
from whoosh import index
from whoosh.qparser import MultifieldParser

idx = index.open_dir("indexdir")
parser = MultifieldParser(["track_name", "artist", "album"], schema=idx.schema)

with idx.searcher() as searcher:
    results = searcher.search(parser.parse("nine inch nails"), groupedby="genre")
    import pdb; pdb.set_trace()
    True