From 5ce2a8ec5c4ebec9449a969e531d71f1694fbed1 Mon Sep 17 00:00:00 2001 From: Daniel Montgomery Date: Wed, 2 Jan 2019 14:28:29 -0600 Subject: [PATCH 1/2] PL-52: Address domain name mismatches. - Use the `fs-demo` domain for all sites and use different subdomains. - Create a config split for the Domain Access solr index so that the site name can be different. See `field_settings.site_name.configuration.site_name`. - Create a config split for the Domain Access solr settings so that the hash can be different. Otherwise the document keys are the same and overwrite each other. See `site_hash`. --- README.md | 2 +- conf/build.d7.properties | 2 +- conf/build.d8-domain.properties | 2 +- conf/build.d8.properties | 2 +- ...earch_api.index.federated_search_index.yml | 128 ++++++++++++++++++ .../d8-domain/search_api_solr.settings.yml | 6 + 6 files changed, 138 insertions(+), 4 deletions(-) create mode 100644 config/config_split/d8-domain/search_api.index.federated_search_index.yml create mode 100644 config/config_split/d8-domain/search_api_solr.settings.yml diff --git a/README.md b/README.md index 9ead007..259f67e 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ If you update Vagrant, you may need to update your vagrant plugins with `vagrant 6. Build the `/src` directory and symlink modules there to make development easier: `phing init` 7. Visit your D8 (standalone) site at [http://d8.fs-demo.local](http://d8.fs-demo.local) 8. Visit your D8 (domain access) site at: - - [http://fs-demo.d8-1.local](http://d8-1.fs-demo.local) + - [http://d8-1.fs-demo.local](http://d8-1.fs-demo.local) - [http://d8-2.fs-demo.local](http://d8-2.fs-demo.local) - [http://d8-3.fs-demo.local](http://d8-3.fs-demo.local) - These sites are for future use, as Domain support has not yet been ported to D8. diff --git a/conf/build.d7.properties b/conf/build.d7.properties index 59713e2..90d59de 100644 --- a/conf/build.d7.properties +++ b/conf/build.d7.properties @@ -11,6 +11,6 @@ drupal.database.host=127.0.0.1 drupal.settings.file_public_path=sites/default/files drupal.settings.file_private_path= drupal.twig.debug= -drupal.uri=http://fs-demo.d7.local +drupal.uri=http://d7.fs-demo.local drupal.hash_salt=528a2e810ba1473af9118387b9ebb9fbe5634047cff5ab3bb29cc360dbf25c7a drupal.root=web/d7/docroot diff --git a/conf/build.d8-domain.properties b/conf/build.d8-domain.properties index d449c47..0bcdff9 100644 --- a/conf/build.d8-domain.properties +++ b/conf/build.d8-domain.properties @@ -12,7 +12,7 @@ drupal.database.host=127.0.0.1 drupal.settings.file_public_path=sites/default/files drupal.settings.file_private_path= drupal.twig.debug= -drupal.uri=http://fs-demo.d8-1.local +drupal.uri=http://d8-1.fs-demo.local drupal.hash_salt=528a2e810ba1473af9118387b9ebb9fbe5634047cff5ab3bb29cc360dbf25c7a drupal.root=web/d8-domain/docroot drupal.config_sync_directory=../../../config/sites/d8 \ No newline at end of file diff --git a/conf/build.d8.properties b/conf/build.d8.properties index e189f6b..1fd9d94 100644 --- a/conf/build.d8.properties +++ b/conf/build.d8.properties @@ -10,7 +10,7 @@ drupal.database.host=127.0.0.1 drupal.settings.file_public_path=sites/default/files drupal.settings.file_private_path= drupal.twig.debug= -drupal.uri=http://fs-demo.d8.local +drupal.uri=http://d8.fs-demo.local drupal.hash_salt=528a2e810ba1473af9118387b9ebb9fbe5634047cff5ab3bb29cc360dbf25c7a drupal.root=web/d8/docroot drupal.config_sync_directory=../../../config/sites/d8 \ No newline at end of file diff --git a/config/config_split/d8-domain/search_api.index.federated_search_index.yml b/config/config_split/d8-domain/search_api.index.federated_search_index.yml new file mode 100644 index 0000000..c997056 --- /dev/null +++ b/config/config_split/d8-domain/search_api.index.federated_search_index.yml @@ -0,0 +1,128 @@ +uuid: 334fdced-7b87-420b-9226-14b7d787d61b +langcode: en +status: true +dependencies: + config: + - search_api.server.local_solr + module: + - search_api + - search_api_federated_solr + - search_api_field_map + - node +id: federated_search_index +name: 'Federated Search Index' +description: '' +read_only: false +field_settings: + federated_date: + label: 'Federated Date' + property_path: mapped_field + type: date + configuration: + field_data: + node: + article: '[node:created:custom:Y-m-d\TH:i:s\Z]' + page: '[node:created:custom:Y-m-d\TH:i:s\Z]' + recipe: '[node:created:custom:Y-m-d\TH:i:s\Z]' + federated_image: + label: 'Federated Image' + property_path: mapped_field + type: string + configuration: + field_data: + node: + article: '[node:field_image:search_api_federated_solr_image:url]' + page: '[node:field_image:search_api_federated_solr_image:url]' + recipe: '[node:field_image:search_api_federated_solr_image:url]' + federated_terms: + label: 'Federated Terms' + property_path: mapped_terms + type: string + federated_title: + label: 'Federated Title' + property_path: mapped_field + type: string + configuration: + field_data: + node: + article: '[node:title]' + page: '[node:title]' + recipe: '[node:title]' + federated_type: + label: 'Federated Type' + property_path: mapped_field + type: string + configuration: + field_data: + node: + article: Article + page: Page + recipe: Recipe + rendered_item: + label: 'Rendered HTML output' + property_path: rendered_item + type: text + configuration: + roles: + anonymous: anonymous + view_mode: + 'entity:node': + article: default + page: default + recipe: default + site_name: + label: 'Site Name' + property_path: site_name + type: string + configuration: + site_name: 'Federated Search Demo (D8, domain access)' + url: + label: URI + property_path: search_api_url + type: string + urls: + label: Urls + property_path: search_api_urls + type: string +datasource_settings: + 'entity:node': + bundles: + default: true + selected: { } + languages: + default: true + selected: { } +processor_settings: + add_url: { } + aggregated_field: { } + entity_status: { } + federated_terms: { } + html_filter: + all_fields: false + fields: + - rendered_item + title: false + alt: false + tags: + b: 2 + em: 1 + h1: 5 + h2: 3 + h3: 2 + strong: 2 + u: 1 + weights: + preprocess_index: -15 + preprocess_query: -15 + mapped_field: { } + mapped_terms: { } + rendered_item: { } + search_api_urls: { } + site_name: { } +tracker_settings: + default: + indexing_order: fifo +options: + index_directly: true + cron_limit: 50 +server: local_solr diff --git a/config/config_split/d8-domain/search_api_solr.settings.yml b/config/config_split/d8-domain/search_api_solr.settings.yml new file mode 100644 index 0000000..ed221ae --- /dev/null +++ b/config/config_split/d8-domain/search_api_solr.settings.yml @@ -0,0 +1,6 @@ +last_optimize: 0 +index_prefix: '' +cron_action: spellcheck +site_hash: jbhd7f +_core: + default_config_hash: pBaH11SiBiDulMHrEUo_lI1kk4-8FpdEfuoHTXskMu0 From 149c57d942a6fb5ee6c0915c5e53c070fe32fe20 Mon Sep 17 00:00:00 2001 From: Daniel Montgomery Date: Wed, 2 Jan 2019 14:35:36 -0600 Subject: [PATCH 2/2] PL-52: Index content after importing config. This allows config overrides for Domain Access to take into affect and avoids overwriting of Solr documents because of identical IDs. --- build.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/build.xml b/build.xml index c447e7f..85111b0 100644 --- a/build.xml +++ b/build.xml @@ -100,6 +100,15 @@ + + + + + + 'node_access_rebuild();' + + demo_umami_content @@ -116,22 +125,13 @@ federated_terms + federated_search federated_search - - - - - - - 'node_access_rebuild();' - -