def test_select_explain_result(self):
        select = Select()
        select._result_dict = create_hits()
        select.explain_result()
        print(select)
        print(repr(select))

        self.assertIsNotNone(select.result)
        self.assertEqual(len(select), 3)
    def _execute(self):
        if self._client is None:
            raise _unbound_index_err

        res_dict = self._client.post(data=self._build_query())
        if self._aggregation is None and self._groupby is None:
            query = Select()
            query.explain_result(res_dict)
        else:
            query = Agg.from_dict(res_dict)
        return query
    def test_select_from_dict(self):
        select = Select.from_dict(create_hits())
        print(select)
        print(repr(select))

        self.assertIsNotNone(select.result)
        self.assertEqual(len(select), 3)
Beispiel #4
0
 def _execute(self):
     res_dict = self._client.post(data=self._build_query())
     if self._aggregation is not None:
         query = Agg.from_dict(res_dict)
     else:
         query = Select.from_dict(res_dict)
     return query
    def test_select_result(self):
        select = Select.from_dict(create_hits())
        print(select.result)

        self.assertIsNotNone(select.result)
        self.assertEqual(len(select.result[0]), 2)