Added term facets to search query. #6543

Added a test for facets.
update in quick_query method also.

```python
-        results = [
-            r.id for r in
-            cls.search_on_elastic_search(phrase)
-        ]

+        result_set = cls.search_on_elastic_search(phrase)
+        results = [
+            r.id for r in
+            result_set
+        ]
+        // result_set can be processed to generate fields for search template.
```