Developing a module that allow boosting specific entity bundles - similar to the feature in Apache Solr for D7. It is implemented as a configurable processor plugin, and the boost value is set on relevant items in alterIndexedItems(). It is done this way to make it a generic Search API solution and to avoid altering the document / item per search backend. Unfortunately is Search API Solr not inheriting the item boost value to the document when preparing it.

The attached patch fix this.

Comments

beltofte created an issue. See original summary.

beltofte’s picture

The bundle boost module is available at https://www.drupal.org/project/search_api_bundle_boost.

beltofte’s picture

Component: Documentation » Code
beltofte’s picture

Issue summary: View changes
mkalkbrenner’s picture

Status: Active » Needs work
Issue tags: +Needs tests

I think we should add a minimal test for it.

beltofte’s picture

StatusFileSize
new2.95 KB
new2.17 KB

Patch updated with a small test.

beltofte’s picture

Status: Needs work » Needs review
beltofte’s picture

Issue tags: -Needs tests
mkalkbrenner’s picture

Status: Needs review » Needs work

The patch looks good but the tests are failing:
https://travis-ci.org/mkalkbrenner/search_api_solr/builds/254469305

https://travis-ci.org/mkalkbrenner/search_api_solr/jobs/254469308

+++ b/tests/src/Kernel/SearchApiSolrTest.php
@@ -256,6 +258,39 @@ class SearchApiSolrTest extends BackendTestBase {
+      $entity = $this->addTestEntity(1, [

The content is "stable" throughout the regression tests. There's already an entity with ID 1.
I suggest that you just pick one of the example entities instead of storing an additional one.

beltofte’s picture

Thanks Markus. I will fix the patch tomorrow.

How are you triggering Travis CI?

mkalkbrenner’s picture

I trigger via github. If you simply fork https://github.com/mkalkbrenner/search_api_solr and create a PR, it will be automatically tested by travis.
But don't use the issue tracker at github. We keep the discussion here.

beltofte’s picture

StatusFileSize
new2.88 KB
new846 bytes

I have updated the patch from creating a new test entity to load one of the existing test entities. See the attached patch and inderdiff. Also added a PR at Github https://github.com/mkalkbrenner/search_api_solr/pull/14.

beltofte’s picture

Status: Needs work » Needs review

  • mkalkbrenner committed 228ab19 on 8.x-1.x authored by beltofte
    Issue #2850160 by beltofte: Document level boost value not inherited...
  • mkalkbrenner committed b6ac923 on 8.x-1.x authored by beltofte
    Issue #2850160 by beltofte, mkalkbrenner: Document level boost value not...
mkalkbrenner’s picture

Status: Needs review » Fixed

committed :-)

Status: Fixed » Closed (fixed)

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