mirror of
https://github.com/wassname/flask-whooshee.git
synced 2026-09-20 12:50:17 +08:00
Update flask_whooshee.py
This commit is contained in:
+2
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user