diff options
author | Mike Crute <mcrute@gmail.com> | 2015-07-29 18:38:22 -0700 |
---|---|---|
committer | Mike Crute <mcrute@gmail.com> | 2015-07-29 18:38:22 -0700 |
commit | 53335ce936e758b816cce584665d1d55914b4ef4 (patch) | |
tree | 3822198638830ea0894ba06136a0e29cea7c05b9 /src/index_search.py | |
download | audiocloud-53335ce936e758b816cce584665d1d55914b4ef4.tar.bz2 audiocloud-53335ce936e758b816cce584665d1d55914b4ef4.tar.xz audiocloud-53335ce936e758b816cce584665d1d55914b4ef4.zip |
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 | ||