Fix TextFilterFacet and make query most important option.
This commit is contained in:
parent
a34c8c72c9
commit
b23147ce48
|
@ -36,9 +36,9 @@ class Facet(object):
|
||||||
|
|
||||||
|
|
||||||
class TextFilterFacet(Facet):
|
class TextFilterFacet(Facet):
|
||||||
def __init__(self, column, query):
|
def __init__(self, column, query, **options):
|
||||||
super(TextFacet, self).__init__(column, type='text', mode='text',
|
super(TextFilterFacet, self).__init__(column, query=query, type='text',
|
||||||
query=query, **options)
|
mode='text', **options)
|
||||||
|
|
||||||
|
|
||||||
class TextFacet(Facet):
|
class TextFacet(Facet):
|
||||||
|
|
|
@ -49,6 +49,8 @@ class FacetTest(unittest.TestCase):
|
||||||
facet = FlaggedFacet(False)
|
facet = FlaggedFacet(False)
|
||||||
self.assertEqual(facet.selection[0]['v']['v'], False)
|
self.assertEqual(facet.selection[0]['v']['v'], False)
|
||||||
self.assertRaises(ValueError, FlaggedFacet, 'false') # no strings
|
self.assertRaises(ValueError, FlaggedFacet, 'false') # no strings
|
||||||
|
facet = TextFilterFacet('column name', 'query')
|
||||||
|
self.assertEqual(facet.query, 'query')
|
||||||
|
|
||||||
def test_selections(self):
|
def test_selections(self):
|
||||||
facet = TextFacet('column name')
|
facet = TextFacet('column name')
|
||||||
|
|
Loading…
Reference in New Issue