- if eventlet:
- pool.spawn_n(self.make_result_cache, search_instance)
- else:
- self.make_result_cache(search_instance)
- if eventlet:
- pool.waitall()
- context.update({
- 'searches': search_instances
- })
+
+ if self.enable_ajax_api:
+ search_instance.ajax_api_url = "%s?%s=%s" % (self.reverse('ajax_api_view', kwargs={'slug': slug}, node=request.node), SEARCH_ARG_GET_KEY, search_string)
+
+ if eventlet and not self.enable_ajax_api:
+ pool = eventlet.GreenPool()
+ for instance in search_instances:
+ pool.spawn_n(lambda x: x.results, search_instance)
+ pool.waitall()
+
+ context.update({
+ 'searches': search_instances,
+ 'favored_results': []
+ })
+
+ try:
+ search = Search.objects.get(string=search_string)
+ except Search.DoesNotExist:
+ pass