Skip to navigation
How to search a whosh index
28.11.21
def search(idir, search_key): ix = open_dir(idir) with ix.searcher(weighting=scoring.Frequency) as searcher: parser = QueryParser("title", ix.schema, group=qparser.OrGroup) parser.add_plugin(qparser.RegexPlugin()) po = parser.parse(search_key) #u"RĂ³mulo" result = searcher.search(po,limit=50) for i in result: print("{1} - {0}".format(dict(i)['title'],dict(i)['isbn13']))
https://whoosh.readthedocs.io/en/latest/searching.html
Reply
Anonymous
Information Epoch 1732528738
Use lower case and keep it short.
Home
Notebook
Contact us