Skip to content
Snippets Groups Projects
myapp.py 401 B
Newer Older
  • Learn to ignore specific revisions
  • from whoosh.fields import *
    import indexing
    
    # Retrieving data
    from whoosh.qparser import QueryParser
    
    ix = indexing.get_index()
    
    with ix.searcher() as searcher:
        # find entries with the words 'first' AND 'last'
        query = QueryParser("content", ix.schema).parse(input("search for something:\n"))
        results = searcher.search(query)
    
        # print all results
        for r in results:
            print(r)