Custom Search Result, Date decay, and result sets larger than the posts per page number
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Start with Feature\SearchOrdering::posts_results() in includes/classes/Feature/SearchOrdering/SearchOrdering.php and reproduce the scenario with date decay, custom results, and two posts per page. Done means the configured custom results remain ahead of the naturally scored result across subsequent pages, including the older flowers and trees posts.
Written by the indexing model from the issue text.
Description
Is your enhancement related to a problem? Please describe.
Currently, if the administrator sets a custom search result and has date decay enabled, the results can be wrongly ordered if the number of posts returned is larger than the number of posts displayed per page.
Although we add terms.ep_custom_result.name^9999 to the query, to boost custom search results, for older documents the score is lowered by the date decay. That is not a problem for small result sets because the plugin reorders the results in Feature\SearchOrdering::posts_results(). That can't happen when the post is on the following page though.
Steps to reproduce
- Enable
Weight results by dateunderPost Searchon the Features page - Create a post titled
Post about flowersand set its date to 10 years ago - Create a post titled
Post about treesand also set its date to 10 years ago - Create a post titled
Post about gardenswith the current date - Create a Custom Search Result to
gardensand set the flowers and trees posts to be displayed first - Set WordPress to only display 2 posts per page
- Search for
gardensand see thePost about gardensbeing displayed on the first page
- Dominant language
- PHP
- Stars
- 1.3k
- Forks
- 325
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 24
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from 10up/ElasticPress
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
10up/ElasticPress#4402 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 45/100
10up/ElasticPress#4390 ·
Maintainers usually reply within 1 day
-
[Release] 5.3.6Open
Difficulty 4/5 3-5 days Newbie friendliness 15/100
10up/ElasticPress#4388 ·
Maintainers usually reply within 1 day
-
Move AI Features from ElasticPress Labs to the ElasticPress PluginPossibly taken @ZacharyRener claimed this 124 days ago. Openenhancement
10up/ElasticPress#4316 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Convert Pointers class to functional componentPossibly taken @ZacharyRener claimed this 288 days ago. Openenhancement
10up/ElasticPress#4261 · 1 assignee ·
Maintainers usually reply within 1 day
All issues in 10up/ElasticPress
Similar issues
-
bug command:plugin-update scope:documentation
Difficulty 1/5 Under an hour Newbie friendliness 83/100
wp-cli/extension-command#572 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Freegle/Iznik#2023 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day