Commit 33e73b8e authored by Michel Pelletier's avatar Michel Pelletier

Fixed date field index type

parent 3f4117bc
...@@ -120,10 +120,10 @@ class Catalog(Item): ...@@ -120,10 +120,10 @@ class Catalog(Item):
('url', 'FieldIndex', 's', 1), ('url', 'FieldIndex', 's', 1),
('title', 'TextIndex', 's', None), ('title', 'TextIndex', 's', None),
('meta_type', 'FieldIndex', 's', None), ('meta_type', 'FieldIndex', 's', None),
('last_modified', 'TextIndex', 'd', None), ('last_modified', 'FieldIndex', 'd', None),
('subject', 'TextIndex', 's', None), ('subject', 'TextIndex', 's', None),
('description', 'TextIndex', 's', None), ('description', 'TextIndex', 's', None),
('date', 'TextIndex', 'd', None), ('date', 'FieldIndex', 'd', None),
('reviewed', 'FieldIndex', 'i', None), ('reviewed', 'FieldIndex', 'i', None),
] ]
...@@ -142,8 +142,14 @@ class Catalog(Item): ...@@ -142,8 +142,14 @@ class Catalog(Item):
self._ztable._data.setOrphanIndex('text_content', 'TextIndex', self._ztable._data.setOrphanIndex('text_content', 'TextIndex',
call_methods=1) call_methods=1)
self._ztable._data.addComputedField('modified_since',
'(_.DateTime() - 1)',
index_type='FieldIndex',
type='d')
self._ztable.update_database_schema(uindex, utype, call) self._ztable.update_database_schema(uindex, utype, call)
def searchResults(self, REQUEST=None, used=None, def searchResults(self, REQUEST=None, used=None,
query_map={ query_map={
type(regex.compile('')): Query.Regex, type(regex.compile('')): Query.Regex,
...@@ -161,6 +167,7 @@ class Catalog(Item): ...@@ -161,6 +167,7 @@ class Catalog(Item):
__call__ = searchResults __call__ = searchResults
def uniqueValuesFor(self, id): def uniqueValuesFor(self, id):
""" return unique values for field index id """ """ return unique values for field index id """
return apply(self._ztable.uniqueValuesFor, (id,)) return apply(self._ztable.uniqueValuesFor, (id,))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment