Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue-638: Increase posts per page limit to 300 and enforce consistently #643

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 39 additions & 57 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion webonary-cloud-api/lambda/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { DbPaths } from './entry.model';

export const MONGO_DB_NAME = process.env.MONGO_DB_NAME as string;

export const DB_MAX_DOCUMENTS_PER_CALL = 100;
export const DB_MAX_DOCUMENTS_PER_CALL = 300;
export const DB_MAX_UPDATES_PER_CALL = 50;

// TODO: Vietnamese seems to have the most Latin diacritics, so use this for insensitive search
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ public static function searchEntries($posts, WP_Query $query): ?array
];

$apiParams['pageNumber'] = $query->query_vars['paged'];
$apiParams['pageLimit'] = $query->query_vars['posts_per_page'];
$apiParams['pageLimit'] = min($query->query_vars['posts_per_page'], 300);

$totalEntries = self::getTotalCount(self::$doSearchEntry, $apiParams);
$query->found_posts = $totalEntries;
Expand Down
Loading