kemitche / l2cs

DEPRECATED - Python library to rewrite Lucene syntax search queries to Amazon CloudSearch syntax
BSD 2-Clause "Simplified" License
8 stars 5 forks source link

KeyError: <class 'whoosh.query.qcore._NullQuery'> #11

Closed kemitche closed 12 years ago

kemitche commented 12 years ago

Query causing this is unknown

./r2/lib/cloudsearch.py 612 _run()  bq = l2cs.convert(self.query, self.lucene_parser)
/usr/lib/python2.7/dist-packages/l2cs.py    242 convert()   return ''.join(pieces)
/usr/lib/python2.7/dist-packages/l2cs.py    90  walk_clause()   handler_fn = HANDLERS[clause.__class__]
kemitche commented 12 years ago

Appears to be caused by an representation of the empty string:

kemitche@kemi-reddit:~/reddit/l2cs$ python l2cs.py '""'
Lucene input: ""
Parsed representation: <_NullQuery>
Lucene form: <_NullQuery>
Traceback (most recent call last):
  File "l2cs.py", line 311, in <module>
    main(sys.argv)
  File "l2cs.py", line 306, in main
    cloudsearch_query = ''.join(walk_clause(parsed))
  File "l2cs.py", line 91, in walk_clause
    handler_fn = HANDLERS[clause.__class__]
KeyError: <class 'whoosh.query.qcore._NullQuery'>