Change Elastic Field structure to cope with Collection base_ids

This commit is contained in:
Benoît Burnichon
2015-06-05 20:14:33 +02:00
parent acb8ed86c8
commit fea47ef5ee
4 changed files with 26 additions and 19 deletions

View File

@@ -20,6 +20,7 @@ class Field
private $is_private;
private $is_facet;
private $thesaurus_roots;
private $used_by_collections;
public static function createFromLegacyField(databox_field $field)
{
@@ -54,9 +55,9 @@ class Field
case databox_field::TYPE_STRING:
case databox_field::TYPE_TEXT:
return Mapping::TYPE_STRING;
default:
throw new Exception(sprintf('Invalid field type "%s", expected "date", "number" or "string".', $type));
}
throw new \InvalidArgumentException(sprintf('Invalid field type "%s", expected "date", "number" or "string".', $type));
}
public function __construct($name, $type, array $options = [])
@@ -97,6 +98,11 @@ class Field
return $this->type;
}
public function getCollections()
{
return $this->collections;
}
public function isSearchable()
{
return $this->is_searchable;