Trees | Indices | Help |
---|
|
1 import whoosh 2 3 from flask.ext.whooshee import AbstractWhoosheer 4 5 from coprs import models 6 from coprs import whooshee11 schema = whoosh.fields.Schema( 12 copr_id=whoosh.fields.NUMERIC(stored=True, unique=True), 13 user_id=whoosh.fields.NUMERIC(stored=True), 14 username=whoosh.fields.TEXT(), 15 # treat dash as a normal character - so searching for example 16 # "copr-dev" will really search for "copr-dev" 17 coprname=whoosh.fields.TEXT( 18 analyzer=whoosh.analysis.StandardAnalyzer( 19 expression=r"\w+(-\.?\w+)*")), 20 description=whoosh.fields.TEXT(), 21 instructions=whoosh.fields.TEXT()) 22 23 models = [models.Copr, models.User] 24 25 @classmethod5727 # TODO: this is not needed now, as users can't change names, but may be 28 # needed later 29 pass30 31 @classmethod33 writer.update_document(copr_id=copr.id, 34 user_id=copr.owner.id, 35 username=copr.owner.name, 36 coprname=copr.name, 37 description=copr.description, 38 instructions=copr.instructions)39 40 @classmethod 44 45 @classmethod47 writer.add_document(copr_id=copr.id, 48 user_id=copr.owner.id, 49 username=copr.owner.name, 50 coprname=copr.name, 51 description=copr.description, 52 instructions=copr.instructions)53 54 @classmethod
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Wed Aug 27 09:50:26 2014 | http://epydoc.sourceforge.net |