Skip to content

[5.x] Limit search query count when there are a lot of them#1311

Open
Jade-GG wants to merge 2 commits into
masterfrom
feature/limit-search-queries
Open

[5.x] Limit search query count when there are a lot of them#1311
Jade-GG wants to merge 2 commits into
masterfrom
feature/limit-search-queries

Conversation

@Jade-GG

@Jade-GG Jade-GG commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

ref: AN-425

We ran into an issue on a site that had 300k+ search queries in the search_query table. While this table should probably be cleaned up, this also presented an issue where the indexer would break due to too many items being indexed, causing the indexing to take too long (and wasting resources).

Originally, I had wanted to do this with a simple orderByDesc('popularity')->limit(10000) directly on the query itself. However, that didn't work as scout will modify the query stripping off the limit in the process.

Instead, this PR sets a minimum popularity value based on what the 10000th highest popularity value is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant