openedx / course-discovery

Service providing access to consolidated course and program metadata
https://edx-discovery.readthedocs.io/en/latest/
GNU Affero General Public License v3.0
57 stars 171 forks source link

fix: update limit for es response #4303

Closed Ali-D-Akbar closed 5 months ago

Ali-D-Akbar commented 6 months ago

PROD-3986 Adds a setting to update_index. This will increase the max_result_window for all existing indexes and subsequently update any newly created index as well.

~Also updates the unit test that previously didn't support a custom value of max_result_window in ES related logic.~ Keeping the same limit count for unit tests as we won't reach this limit while testing.

Ali-D-Akbar commented 5 months ago

Why do we need it in 2 management commands?

To update this setting for both cases where we're either updating (through update_index) or creating new/rebuilding indexes (through search_index).

Wouldn't the settings update when only one runs?

In case when we create new index, it won't have the settings. These settings work for pre-existing indexes.

Would it be nicer to extract this into a separate management command?

That's debatable although the same command will be needed to run in both of the commands above.