1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed XenES_Search_SourceHandler_ElasticSearch and XenES_Api, different index naming methods

Discussion in 'Enhanced Search Resolved Bugs' started by thedude, Aug 21, 2015.

  1. thedude

    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: Aug 21, 2015
  2. Daniel Hood

    Daniel Hood Well-Known Member

    On a semi-related note, why is it using
    PHP:
    XenForo_Application::get('config')->db
    instead of
    PHP:
    XenForo_Application::getDb()
     
  3. Chris D

    Chris D XenForo Developer Staff Member

    It's getting the db name value from the config, not the actual database adapter object.
     
    Daniel Hood likes this.
  4. Mike

    Mike XenForo Developer Staff Member

    I've fixed this now, thanks.

    For reference, Elasticsearch hasn't allowed upper case letters in indexes (at least historically).
     
    thedude likes this.

Share This Page