This seems to be an issue occurring with both Elasticsearch Connector and Search API Solr Search modules. I have those marked as related issues; I was told that this was a problem with Search API itself and not the individual Elasticsearch Connector module in my open related issue about this problem with elasticsearch connector.

Comments

brettboylen created an issue. See original summary.

brettboylen’s picture

Status: Active » Needs review
StatusFileSize
new326 bytes

Added a patch that I believe fixes the issue.

borisson_’s picture

Version: 8.x-1.0-rc4 » 8.x-1.x-dev

Not sure if this resolves the issue. I see that this issue was made against an old Search API version. Does this still happen on the latest version?

drunken monkey’s picture

Component: General code » Plugins
Priority: Major » Normal
Status: Needs review » Needs work
Issue tags: +Needs tests

The proposed change does make sense, thanks! When a boost was already set for an item, it does make sense that old and new boost should be multiplie.

However, as Joris says, it's unclear how this relates to your problem description. Do you have multiple processors enabled that influence boost, or some other item boost setup?
Moreover, without your change, the type boost processor should still work fine, just overwrite whatever boost comes in before. So, it's even less clear what the relation between problem and solution is.

Finally, before we can commit this, this would also need a regression test. Probably just another test in TypeBoostTest which sets a boost on an item before sending it to be preprocessed and then checking whether the boosts got correctly multiplied.

brettboylen’s picture

@drunken monkey,

We are using elasticsearch_connector which lets boosts to be set on a per-field basis. The problem is that type-specific boosting doesn't work at all in this case. I can give you more details on exactly what we have setup, upon request, if you want. I have two child issues associated with this same issue report. One is for the search api solr module, so this does not seem to only be affecting elasticsearch_connector.

drunken monkey’s picture

What would be helpful is if you could tell me whether the items arriving in the backend plugin’s indexItems() method (no matter whether ES or Solr) actually have an item boost set according to their type. If they do, the problem is not in the Search API, but in the backend plugin. (It's possible that the same bug exists for both the ES and Solr plugins – could, e.g., be Lucene-specific.)

brettboylen’s picture

I can review that sometime this week and get back to you on that request. You may be correct in stating that it could be the same bug existing in both modules, but I'll have to check and get back to you.

Thanks!

kleve’s picture

@drunken-monkey I can verify that the boost is indeed passed to the backend plugin´s indexItems(). For more details, see related post here https://www.drupal.org/project/elasticsearch_connector/issues/2980257#co...

drunken monkey’s picture

Title: Content-type specific boosting not working at all » Do not overwrite pre-existing boosts in type boost processor
Status: Needs work » Needs review
Issue tags: -Needs tests
StatusFileSize
new1.93 KB

Alright, thanks for confirming this!
Then let’s just add the test and commit this small improvement.

borisson_’s picture

Status: Needs review » Reviewed & tested by the community

Yep, that improvement does seem like it improves things. Great work @drunken monkey!

brettboylen’s picture

Good work with the tests! My sincerest apologies that I didn't have time to go back and confirm what you had requested regarding indexItems(). Too busy with work, unfortunately.

drunken monkey’s picture

Seems I forgot to upload the actual patch? Doing that now – if test bot is happy, I’ll commit.

  • drunken monkey committed e701062 on 8.x-1.x
    Issue #2985131 by drunken monkey, brettboylen, borisson_, Kleve: Fixed "...
drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

Alright, looks good. Thanks for reviewing, Joris!
Committed.
Thanks again, everyone!

Status: Fixed » Closed (fixed)

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