I am trying to find document by value in a specific range. The official document doesn't give example for different types of fields and search methods. Any smart guy can give me a link with more example and application? Any hint?
Thank you!
Here's my codes,
from whoosh.index import create_in
from whoosh.fields import *
from whoosh.qparser import QueryParser
schema = Schema(temperature=NUMERIC(float, stored=True))
ix = create_in("indexdir", schema)
writer = ix.writer()
writer.add_document(temperature = 32.3)
writer.commit()
with ix.searcher() as searcher:
query = QueryParser("temperature", ix.schema).parse("temperature:>20.0") ## should be something like this
print(searcher.search(query)[0])