Skip to content

Commit

Permalink
Moved "q" after "index" and before "results" in main config form.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Berthereau authored and Daniel Berthereau committed Jan 6, 2025
1 parent dfcb520 commit 8dc3791
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 59 deletions.
26 changes: 14 additions & 12 deletions data/configs/search_config.default.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,6 @@
'validate_form' => false,
],

// To be moved in filters? This is only the first form filter q and nothing really specific, once auto-indexing for filters will be implemented.
'q' => [
'suggester' => 1,
'suggest_url' => '',
'suggest_url_param_name' => '',
'suggest_limit' => null,
'suggest_fill_input' => false,
'fulltext_search' => null,
'remove_diacritics' => false,
'default_search_partial_word' => false,
],

'index' => [
'aliases' => [
'title' => [
Expand Down Expand Up @@ -310,6 +298,20 @@
],
],

// TODO To be moved in form.
// This is only the first form filter q and nothing really specific, once auto-indexing for filters will be implemented.
'q' => [
'label' => $translate('Search'),
'suggester' => 1,
'suggest_url' => '',
'suggest_url_param_name' => '',
'suggest_limit' => null,
'suggest_fill_input' => false,
'fulltext_search' => null,
'remove_diacritics' => false,
'default_search_partial_word' => false,
],

// All filters except "advanced" are managed the same via querier:
// a form is a query configurator.
'form' => [
Expand Down
94 changes: 47 additions & 47 deletions src/Form/Admin/SearchConfigConfigureForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,53 @@ public function init(): void
])
;

$this
->add([
'name' => 'index',
'type' => Fieldset::class,
'options' => [
'label' => 'Indexes', // @translate
],
])
->get('index')

->add([
'name' => 'aliases',
'type' => CommonElement\DataTextarea::class,
'options' => [
'label' => 'Aliases and aggregated fields', // @translate
'info' => 'List of fields that refers to one or multiple indexes (properties with internal search engine, native indexes with Solr), formatted "name = label", then the list of properties and an empty line. The name must not be a property term or a reserved keyword.', // @translate
'documentation' => 'https://gitlab.com/Daniel-KM/Omeka-S-module-AdvancedSearch/-/blob/master/data/configs/search_engine.internal.php',
'as_key_value' => true,
'key_value_separator' => '=',
'data_options' => [
'name' => null,
'label' => null,
'fields' => ',',
],
'data_text_mode' => 'last_is_list',
],
'attributes' => [
'id' => 'index_aliases',
'placeholder' => <<<'STRING'
author = Author
dcterms:creator
dcterms:contributor
title = Title
dcterms:title
dcterms:alternative
date = Date
dcterms:date
dcterms:created
dcterms:issued
STRING,
'rows' => 30,
],
])
;

$this
// The main search field is "q", not "fulltext_search" or "search".
->add([
Expand Down Expand Up @@ -305,53 +352,6 @@ public function init(): void
],
]);

$this
->add([
'name' => 'index',
'type' => Fieldset::class,
'options' => [
'label' => 'Indexes', // @translate
],
])
->get('index')

->add([
'name' => 'aliases',
'type' => CommonElement\DataTextarea::class,
'options' => [
'label' => 'Aliases and aggregated fields', // @translate
'info' => 'List of fields that refers to one or multiple indexes (properties with internal search engine, native indexes with Solr), formatted "name = label", then the list of properties and an empty line. The name must not be a property term or a reserved keyword.', // @translate
'documentation' => 'https://gitlab.com/Daniel-KM/Omeka-S-module-AdvancedSearch/-/blob/master/data/configs/search_engine.internal.php',
'as_key_value' => true,
'key_value_separator' => '=',
'data_options' => [
'name' => null,
'label' => null,
'fields' => ',',
],
'data_text_mode' => 'last_is_list',
],
'attributes' => [
'id' => 'index_aliases',
'placeholder' => <<<'STRING'
author = Author
dcterms:creator
dcterms:contributor
title = Title
dcterms:title
dcterms:alternative
date = Date
dcterms:date
dcterms:created
dcterms:issued
STRING,
'rows' => 30,
],
])
;

// Settings for the form querier (advanced form and filters).

/** @var \AdvancedSearch\Form\Admin\SearchConfigFilterFieldset $filterFieldset */
Expand Down

0 comments on commit 8dc3791

Please sign in to comment.