Update flask_whooshee.py

This commit is contained in:
jordanfung
2013-10-14 18:44:10 +08:00
parent 6478b0de31
commit ae3bed1f8b
+2 -2
View File
@@ -108,7 +108,7 @@ class Whooshee(object):
model.query_class = WhoosheeQuery
return wh
def register_model(self, analyzer=None, *index_fields):
def register_model(self, *index_fields, **kw):
# construct subclass of AbstractWhoosheer for a model
class ModelWhoosheer(AbstractWhoosheer):
pass
@@ -125,7 +125,7 @@ class Whooshee(object):
primary = field.name
schema_attrs[field.name] = whoosh.fields.NUMERIC(stored=True, unique=True)
elif field.name in index_fields:
schema_attrs[field.name] = whoosh.fields.TEXT(analyzer=analyzer)
schema_attrs[field.name] = whoosh.fields.TEXT(**kw)
mwh.schema = whoosh.fields.Schema(**schema_attrs)
# we can't check with isinstance, because ModelWhoosheer is private
# so use this attribute to find out