Rasmus Vind
Well-known member
Hey guys,
I just purchased the ES addon. I am excited to use it. I am taking things slowly, so I installed this addon, and had a look at my search dialog before enabling ES. I found that the default order was not set, most likely because the ES addon sets the default order to "relevance", even if it is not enabled yet.
I made the following change:
Which makes it refrain from changing the default unless the ES addon is enabled.
Before:
After:
I hope you will accept this patch.
I just purchased the ES addon. I am excited to use it. I am taking things slowly, so I installed this addon, and had a look at my search dialog before enabling ES. I found that the default order was not set, most likely because the ES addon sets the default order to "relevance", even if it is not enabled yet.
I made the following change:
Code:
--- a/library/XenES/Proxy/ControllerSearch.php
+++ b/library/XenES/Proxy/ControllerSearch.php
@@ -12,6 +12,7 @@ class XenES_Proxy_ControllerSearch extends XFCP_XenES_Proxy_ControllerSearch
if ($result instanceof XenForo_ControllerResponse_View
&& !empty($result->params['search'])
&& empty($result->params['search']['existing'])
+ && XenForo_Application::getOptions()->enableElasticsearch
)
{
$result->params['search']['order'] = XenForo_Application::getOptions()->esDefaultSearchOrder;
@@ -22,7 +23,7 @@ class XenES_Proxy_ControllerSearch extends XFCP_XenES_Proxy_ControllerSearch
public function actionSearch()
{
- if (!$this->_request->getParam('order'))
+ if (!$this->_request->getParam('order') && XenForo_Application::getOptions()->enableElasticsearch)
{
$this->_request->setParam('order', XenForo_Application::getOptions()->esDefaultSearchOrder);
}
Before:
After:
I hope you will accept this patch.