Wallmander\ElasticsearchIndexer\Model\Config::getIndexName PHP Method

getIndexName() public static method

public static getIndexName ( $blogID )
    public static function getIndexName($blogID)
    {
        $indexName = static::option('index_name');
        if (!$indexName) {
            // Generate a name
            $siteUrl = get_site_url($blogID);
            $indexName = preg_replace('#https?://(www\\.)?#i', '', $siteUrl);
            $indexName = preg_replace('#[^\\w]#', '', $indexName);
            static::setOption('index_name', $indexName);
        }
        $indexName .= '-' . $blogID;
        return apply_filters('esi_index_name', $indexName);
    }

Usage Example

 /**
  * @param int|null $blogID
  *
  * @return string
  */
 public function getIndexName($blogID = null)
 {
     if ($blogID === null) {
         $blogID = $this->blogID;
     }
     return Config::getIndexName($blogID);
 }
All Usage Examples Of Wallmander\ElasticsearchIndexer\Model\Config::getIndexName