Support from Acquia helps fund testing for Drupal Acquia logo

Comments

larowlan created an issue. See original summary.

larowlan’s picture

Title: add clustering support » add clustering/related searches support

  • larowlan committed 8a18acd on 2886318-clustering-support
    Issue #2886318 by larowlan: add clustering/related searches support
    
larowlan’s picture

larowlan’s picture

Assigned: Unassigned » larowlan

Adds tests and clustering support to search service.

Block to come tomorrow.

  • larowlan committed 8b3f235 on 2886318-clustering-support
    Issue #2886318 by larowlan: add clustering/related searches support
    
larowlan’s picture

Status: Active » Needs review
FileSize
9.47 KB

  • larowlan committed e26c791 on 2886318-clustering-support
    Issue #2886318 by larowlan: add clustering/related searches support
    
larowlan’s picture

I will work on block with @pasan.gamage tomorrow

  • larowlan committed 5667b35 on 2886318-clustering-support
    Issue #2886318 by larowlan: add clustering/related searches support
    
larowlan’s picture

  • larowlan committed 7bc7b2e on 2886318-clustering-support
    Issue #2886318 by larowlan: add clustering/related searches support
    
pasan.gamage’s picture

RelatedSearchesBlock class

larowlan’s picture

Status: Needs review » Needs work
  1. +++ b/src/Plugin/Block/RelatedSearchesBlock.php
    @@ -0,0 +1,34 @@
    +
    

    nit: superfluous empty line here

  2. +++ b/src/Plugin/Block/RelatedSearchesBlock.php
    @@ -0,0 +1,34 @@
    +    $searcher = \Drupal::service('google_appliance.search');
    +    $routeMatch = \Drupal::service('current_route_match');
    

    nit: these need to be injected by making the block implement ContainerFactoryPluginInterface, see the existing SearchBlock for example of how to inject services.

  3. +++ b/src/Plugin/Block/RelatedSearchesBlock.php
    @@ -0,0 +1,34 @@
    +  public function getCacheContexts() {
    

    nit: needs a docblock - {@inheritdoc} will suffice

larowlan’s picture

And we need to make the test pass