PHRAS-2879_facet-order_4.1

save all facet settings in conf, order is preserved in admin/search-engine-settings.
todo : ux to re-order facets
todo : return facets into query results in this setting order.
todo : migration from dbox settings (field struct) to conf ; remove field setting from admin
This commit is contained in:
Jean-Yves Gaulier
2020-01-22 12:26:34 +01:00
parent 579ba471c4
commit 2ccdcfed27
3 changed files with 135 additions and 85 deletions

View File

@@ -13,6 +13,7 @@ namespace Alchemy\Phrasea\Controller\Admin;
use Alchemy\Phrasea\Controller\Controller;
use Alchemy\Phrasea\SearchEngine\Elastic\ElasticsearchSettingsFormType;
use Alchemy\Phrasea\SearchEngine\Elastic\ElasticsearchOptions;
use Alchemy\Phrasea\SearchEngine\Elastic\Structure\GlobalStructure;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
@@ -85,7 +86,10 @@ class SearchEngineController extends Controller
*/
private function getConfigurationForm(ElasticsearchOptions $options)
{
return $this->app->form(new ElasticsearchSettingsFormType(), $options, [
/** @var GlobalStructure $g */
$g = $this->app['search_engine.structure'];
return $this->app->form(new ElasticsearchSettingsFormType($g, $options), $options, [
'action' => $this->app->url('admin_searchengine_form'),
]);
}