Support for "More like this" is very limited and incorrect.

Comments

jover created an issue. See original summary.

jover’s picture

Assigned: jover » Unassigned
Status: Active » Needs review
StatusFileSize
new2.11 KB

Patch available.

jover’s picture

StatusFileSize
new2.21 KB

Updated patch (removed mistake in backwards compatibility of input parameter "id").

juampynr’s picture

@jover, how can I test this patch? Can you provide a list of steps?

travismiller’s picture

I was able to to test this patch with the following:

before the patch:

$ drush cache-rebuild && drush php
Psy Shell v0.8.11 (PHP 7.0.22 — cli) by Justin Hileman
>>> array_map(function ($x) {return $x->search_api_id;}, views_get_view_result('elastic_content', 'default', 'entity:node/2244:en'));
=> [
     "entity:node/2244:en",
   ]
>>>

after the patch:

$ drush cache-rebuild && drush php
Psy Shell v0.8.11 (PHP 7.0.22 — cli) by Justin Hileman
>>> array_map(function ($x) {return $x->search_api_id;}, views_get_view_result('elastic_content', 'default', 'entity:node/2244:en'));
=> [
     "entity:node/2248:en",
     "entity:node/103:en",
     "entity:node/1179:en",
     "entity:node/1475:en",
     "entity:node/490:en",
     "entity:node/1494:en",
     "entity:node/1466:en",
     "entity:node/1893:en",
     "entity:node/1424:en",
     "entity:node/1905:en",
   ]
>>>
ghuygens’s picture

StatusFileSize
new2.55 KB

Updated the location where you add the more like this query. This is now rendered beneath the original build query. Because the more like this query was overwritten by the original build query.

Also changed the query parameter of the more like this query as this needs to append to the original query when available or needs to work on its own.

jover’s picture

Status: Needs review » Reviewed & tested by the community

Patch #6 is working for us...

jover’s picture

  • skek committed e230768 on 8.x-5.x authored by ghuygens
    Issue #2892593 by jover, ghuygens: D8 - More like this support
    
skek’s picture

Status: Reviewed & tested by the community » Fixed

Thank you for the patch. It has been applied.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.