Fix 'count-of' searches (e.g., tags:#>3). Add a small blurb to the manual.

This commit is contained in:
Charles Haley 2011-04-26 15:06:30 +01:00
parent ffbc7931f2
commit e765da76f6
2 changed files with 3 additions and 3 deletions

View File

@ -406,11 +406,9 @@ class ResultCache(SearchQueryParser): # {{{
if val_func is None: if val_func is None:
loc = self.field_metadata[location]['rec_index'] loc = self.field_metadata[location]['rec_index']
val_func = lambda item, loc=loc: item[loc] val_func = lambda item, loc=loc: item[loc]
dt = self.field_metadata[location]['datatype']
q = '' q = ''
val_func = lambda item, loc=loc: item[loc]
cast = adjust = lambda x: x cast = adjust = lambda x: x
dt = self.field_metadata[location]['datatype']
if query == 'false': if query == 'false':
if dt == 'rating' or location == 'cover': if dt == 'rating' or location == 'cover':

View File

@ -365,6 +365,8 @@ Dates and numeric fields support the relational operators ``=`` (equals), ``>``
Rating fields are considered to be numeric. For example, the search ``rating:>=3`` will find all books rated 3 Rating fields are considered to be numeric. For example, the search ``rating:>=3`` will find all books rated 3
or higher. or higher.
You can search for the number of items in multiple-valued fields such as tags). These searches begin with the character ``#``, then use the same syntax as numeric fields. For example, to find all books with more than 4 tags, use ``tags:#>4``. To find all books with exactly 10 tags, use ``tags:#=10``.
Series indices are searchable. For the standard series, the search name is 'series_index'. For Series indices are searchable. For the standard series, the search name is 'series_index'. For
custom series columns, use the column search name followed by _index. For example, to search the indices for a custom series columns, use the column search name followed by _index. For example, to search the indices for a
custom series column named ``#my_series``, you would use the search name ``#my_series_index``. custom series column named ``#my_series``, you would use the search name ``#my_series_index``.