When you add the type-boost initially or save it and you configured bundles to use "Use datasource default", it will be saved, but next the form is loaded it will default to 0.0, and re-saving it would led to a lot of bundles with zero boostings.

Comments

hanoii created an issue. See original summary.

hanoii’s picture

Status: Needs work » Needs review
StatusFileSize
new988 bytes

Attached is a simple patch to fix this.

drunken monkey’s picture

Component: General code » Plugins
StatusFileSize
new1.82 KB
new1.82 KB
new2.79 KB

Great catch, thanks a lot!
A bit weird that no-one noticed this before … Either the processor is hugely unpopular or there’s a lot of broken sites now out there. Neither of those sound nice.
Anyways, the patch looks great, but needs tests. Added in the attached revision, please review!

vinlaurens’s picture

Status: Needs review » Reviewed & tested by the community

Tested this and works good on my instance. Steps I took:

Before patch:
- Drupal 8.6.10 with search_api enabled.
- Went to /admin/config/search/search-api/index/default_index/processors and enabled "Type-specific boosting".
- In tab "Type specific boosting" set "Boost for the Article bundle" and "Boost for the Basic page bundle" to "Use datasource default".
- Save the values.
- "Boost for the Article bundle" and and "Boost for the Basic page bundle" show 0.0 as value.

After patching:
- Refresh the page, see "Use datasource default" as default value in the field instead of 0.0.
- Save one of the bundles with 0.0 as value in the dropdown, the other bundle still has "Use datasource default" as default value.
- Value 0.0 persisted while other bundle shows the default "Use datasource default".

  • drunken monkey committed e3f07e8 on 8.x-1.x authored by hanoii
    Issue #3036173 by hanoii, drunken monkey, vinlaurens: Fixed bundle boost...
drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

Good to hear, thanks a lot for testing!
Committed.
Thanks again, everyone!

Status: Fixed » Closed (fixed)

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

vidorado’s picture

Still having this issue in Search API 8.x-1.23

Attaching a patch ;)

vidorado’s picture

I can confirm that this issue is now resolved in Search API 1.28