def test_facet_name_and_type(self): response = self.solr.select(('q', '*:*'), ('rows', 0), ('facet', 'true'), ('facet.field', 'name'), ('facet.field', 'type')) facet_fields = response.facet_counts['facet_fields'] names = pairwise_dict(facet_fields['name']) eq_(names['Mona Lisa'], 4) eq_(names['American Gothic'], 2) eq_(names['Starry Night'], 1) eq_(names['The Scream'], 1) types = facet_fields['type'] types = pairwise_dict(types) eq_(types['painting'], 8)
def test_facet_name_and_type(self): response = self.solr.select( ( 'q', '*:*' ), ( 'rows', 0), ( 'facet', 'true' ), ( 'facet.field', 'name' ), ( 'facet.field', 'type' ) ) facet_fields = response.facet_counts['facet_fields'] names = pairwise_dict(facet_fields['name']) eq_(names['Mona Lisa'], 4) eq_(names['American Gothic'], 2) eq_(names['Starry Night'], 1) eq_(names['The Scream'], 1) types = facet_fields['type'] types = pairwise_dict(types) eq_(types['painting'], 8)
def test_facet_type(self): response = self.solr.select(('q', '*:*'), ('rows', 0), ('facet', 'true'), ('facet.field', 'type')) facet_fields = response.facet_counts['facet_fields'] types = facet_fields['type'] types = pairwise_dict(types) eq_(types['painting'], 8)
def test_facet_type(self): response = self.solr.select( ( 'q', '*:*' ), ( 'rows', 0), ( 'facet', 'true' ), ( 'facet.field', 'type' ) ) facet_fields = response.facet_counts['facet_fields'] types = facet_fields['type'] types = pairwise_dict(types) eq_(types['painting'], 8)
def test_pairwise_dict(self): eq_(pairwise_dict([]), {}) eq_(pairwise_dict(['a', 1, 'b', 'dog']), { 'a' : 1, 'b' : 'dog' })
def test_pairwise_dict(self): eq_(pairwise_dict([]), {}) eq_(pairwise_dict(['a', 1, 'b', 'dog']), {'a': 1, 'b': 'dog'})