summaryrefslogtreecommitdiff
path: root/src/index_search.py
diff options
context:
space:
mode:
authorMike Crute <mcrute@gmail.com>2015-07-29 18:38:22 -0700
committerMike Crute <mcrute@gmail.com>2015-07-29 18:38:22 -0700
commit53335ce936e758b816cce584665d1d55914b4ef4 (patch)
tree3822198638830ea0894ba06136a0e29cea7c05b9 /src/index_search.py
downloadaudiocloud-53335ce936e758b816cce584665d1d55914b4ef4.tar.bz2
audiocloud-53335ce936e758b816cce584665d1d55914b4ef4.tar.xz
audiocloud-53335ce936e758b816cce584665d1d55914b4ef4.zip
Initial importHEADmaster
Diffstat (limited to 'src/index_search.py')
-rw-r--r--src/index_search.py10
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 @@
1from whoosh import index
2from whoosh.qparser import MultifieldParser
3
4idx = index.open_dir("indexdir")
5parser = MultifieldParser(["track_name", "artist", "album"], schema=idx.schema)
6
7with idx.searcher() as searcher:
8 results = searcher.search(parser.parse("nine inch nails"), groupedby="genre")
9 import pdb; pdb.set_trace()
10 True