diff options
Diffstat (limited to 'src/index_search.py')
-rw-r--r-- | src/index_search.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/index_search.py b/src/index_search.py new file mode 100644 index 0000000..805a9fb --- /dev/null +++ b/src/index_search.py | |||
@@ -0,0 +1,10 @@ | |||
1 | from whoosh import index | ||
2 | from whoosh.qparser import MultifieldParser | ||
3 | |||
4 | idx = index.open_dir("indexdir") | ||
5 | parser = MultifieldParser(["track_name", "artist", "album"], schema=idx.schema) | ||
6 | |||
7 | with idx.searcher() as searcher: | ||
8 | results = searcher.search(parser.parse("nine inch nails"), groupedby="genre") | ||
9 | import pdb; pdb.set_trace() | ||
10 | True | ||