Fix empty mappings for old ES versions

This commit is contained in:
Tim Nagel 2014-08-07 09:36:23 +10:00
commit 20033709cf
6 changed files with 62 additions and 13 deletions

View file

@ -35,6 +35,14 @@ class TypeConfig
$this->name = $name;
}
/**
* @return string|null
*/
public function getIndexAnalyzer()
{
return $this->getConfig('index_analyzer');
}
/**
* @return array
*/
@ -43,6 +51,9 @@ class TypeConfig
return $this->mapping;
}
/**
* @return string|null
*/
public function getModel()
{
return isset($this->config['persistence']['model']) ?
@ -57,4 +68,19 @@ class TypeConfig
{
return $this->name;
}
/**
* @return string|null
*/
public function getSearchAnalyzer()
{
return $this->getConfig('search_analyzer');
}
private function getConfig($key)
{
return isset($this->config[$key]) ?
$this->config[$key] :
null;
}
}