def test_token_boost(): from whoosh.analysis import RegexTokenizer, DoubleMetaphoneFilter ana = RegexTokenizer() | DoubleMetaphoneFilter() field = fields.TEXT(analyzer=ana, phrase=False) results = list(field.index(u("spruce view"))) assert_equal(results, [('SPRS', 1, 1.0, b('\x00\x00\x00\x01')), ('FF', 1, 0.5, b('\x00\x00\x00\x01')), ('F', 1, 1.0, b('\x00\x00\x00\x01'))])
class ObjectD(db.Model, BlogishBlob): __tablename__ = 'objectD' __searchable__ = ['title'] __analyzer__ = StemmingAnalyzer() | DoubleMetaphoneFilter()