porting PHRAS-1578/PHRAS-1579/PHRAS-1621/PHRAS-1675/PHRAS-1404/PHRAS-1336 to 4.1

This commit is contained in:
Mike Ng
2018-01-03 15:26:43 +04:00
parent 0d7c2bd52d
commit 071ce25b31
21 changed files with 842 additions and 189 deletions

View File

@@ -15,6 +15,7 @@ use Alchemy\Phrasea\Cache\Exception;
use Alchemy\Phrasea\Collection\Reference\CollectionReference;
use Alchemy\Phrasea\Controller\Controller;
use Alchemy\Phrasea\Core\Configuration\DisplaySettingService;
use Alchemy\Phrasea\SearchEngine\Elastic\ElasticsearchOptions;
use Alchemy\Phrasea\SearchEngine\Elastic\Search\QueryContextFactory;
use Alchemy\Phrasea\SearchEngine\Elastic\Structure\Structure;
use Alchemy\Phrasea\SearchEngine\Elastic\ElasticSearchEngine;
@@ -280,11 +281,12 @@ class QueryController extends Controller
$json['parsed_query'] = $result->getEngineQuery();
/** End debug */
$fieldLabels = [
'Base_Name' => $this->app->trans('prod::facet:base_label'),
'Collection_Name' => $this->app->trans('prod::facet:collection_label'),
'Type_Name' => $this->app->trans('prod::facet:doctype_label'),
];
$fieldLabels = [];
// add technical fields
foreach(ElasticsearchOptions::getAggregableTechnicalFields() as $k => $f) {
$fieldLabels[$k] = $this->app->trans($f['label']);
}
// add databox fields
foreach ($this->app->getDataboxes() as $databox) {
foreach ($databox->get_meta_structure() as $field) {
if (!isset($fieldLabels[$field->get_name()])) {