mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
45fbe9fa27
commit
f4fb43875f
@ -557,6 +557,9 @@ class Search(object):
|
|||||||
if not q:
|
if not q:
|
||||||
return all_book_ids
|
return all_book_ids
|
||||||
|
|
||||||
|
if not isinstance(q, type(u'')):
|
||||||
|
q = q.decode('utf-8')
|
||||||
|
|
||||||
# We construct a new parser instance per search as pyparsing is not
|
# We construct a new parser instance per search as pyparsing is not
|
||||||
# thread safe. On my desktop, constructing a SearchQueryParser instance
|
# thread safe. On my desktop, constructing a SearchQueryParser instance
|
||||||
# takes 0.000975 seconds and restoring it from a pickle takes
|
# takes 0.000975 seconds and restoring it from a pickle takes
|
||||||
@ -567,8 +570,9 @@ class Search(object):
|
|||||||
self.keypair_search,
|
self.keypair_search,
|
||||||
prefs[ 'limit_search_columns' ],
|
prefs[ 'limit_search_columns' ],
|
||||||
prefs[ 'limit_search_columns_to' ], self.all_search_locations)
|
prefs[ 'limit_search_columns_to' ], self.all_search_locations)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ret = sqp.parse(query)
|
ret = sqp.parse(q)
|
||||||
finally:
|
finally:
|
||||||
sqp.dbcache = None
|
sqp.dbcache = None
|
||||||
return ret
|
return ret
|
||||||
|
Loading…
x
Reference in New Issue
Block a user