Fixed XenES_Search_SourceHandler_ElasticSearch and XenES_Api, different index naming methods

thedude

Well-known member
Potential issue if either a custom ES index name specified in AdminCP, or the database name contains any uppercase characters (assuming ES uses case-sensitive index names).

XenES_Search_SourceHandler_ElasticSearch::__construct:
Code:
$this->_indexName = XenForo_Application::get('options')->elasticSearchIndex;
if (!$this->_indexName)
{
    $this->_indexName = XenForo_Application::get('config')->db->dbname;
}

XenES_Api::__construct:
Code:
$this->_indexName = strtolower(XenForo_Application::get('options')->elasticSearchIndex);
if (!$this->_indexName)
{
    $this->_indexName = strtolower(XenForo_Application::get('config')->db->dbname);
}
 
Last edited:
On a semi-related note, why is it using
PHP:
XenForo_Application::get('config')->db
instead of
PHP:
XenForo_Application::getDb()
 
I've fixed this now, thanks.

For reference, Elasticsearch hasn't allowed upper case letters in indexes (at least historically).
 
Top Bottom