1

I am building a search engine and would like to concurrently search for strings and dates. In my index date is my date field and name is my string field:

ix = index.open_dir(dirname)
schema = ix.schema

mp = qparser.MultifieldParser(['date', 'name'], schema, group = og, termclass=FuzzyTerm)

# Add the DateParserPlugin to the parser
mp.add_plugin(DateParserPlugin(free=True))

The examples for date-searching in the Whoosh documentation include the date-field as a prefix to a date search like:

q = qp.parse(u"date:2005062401")      

How should dates be parsed, in conjunction with strings, in a multi-field query? Is the string field to be separated from the date like the below example?

q = qp.parse(u"date:2005062401, name:tom")      

I could not find an answer to this question in the documentation, hence my asking here.

References: https://whoosh.readthedocs.io/en/latest/dates.html

user 123342
  • 463
  • 1
  • 9
  • 21

0 Answers0