Skip to content

Boost products by recently created #3550

Answered by rbayet
superdav42 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @superdav42,

I thought I had given an answer but looks like that's not the case.
The way I would do that would be to

  • create a decimal attribute "creation date penalty" or "product age penalty"
  • create a new Datasource that will work with a LUT (look-up table) initialized by the constructor for instance with 366 slots
    • whose keys would be dates (YYYY-mm-dd) from today to today-365 days
    • whose values would be 1, 1/2, 1/3, 1/4, ..., 1/365

When the datasource loops on products to index

  • if the product creation date is earlier than today (just in case) the attribute value is 1
  • if the product creation date exists in the LUT, it gets the value : 1 if the product was created today, 1/2 if…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by superdav42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants
Converted from issue

This discussion was converted from issue #3509 on March 04, 2025 10:23.