Skip to content

Commit 536874e

Browse files
committed
optimize for elasticsearch
1 parent 57c7b57 commit 536874e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

readthedocs/settings/base.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,18 +343,23 @@ def USE_PROMOS(self): # noqa
343343
ES_INDEXES = {
344344
'project': {
345345
'name': 'project_index',
346-
'settings': {'number_of_shards': 5,
346+
'settings': {'number_of_shards': 1,
347347
'number_of_replicas': 1
348348
}
349349
},
350350
'page': {
351351
'name': 'page_index',
352352
'settings': {
353-
'number_of_shards': 5,
354-
'number_of_replicas': 1,
353+
'number_of_shards': 3,
354+
'number_of_replicas': 3,
355+
"index": {
356+
"sort.field": ["project", "version"]
357+
}
355358
}
356359
},
357360
}
361+
# Disable auto refresh for increasing index performance
362+
ELASTICSEARCH_DSL_AUTO_REFRESH = False
358363

359364
ALLOWED_HOSTS = ['*']
360365

readthedocs/settings/test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class CommunityTestSettings(CommunityDevSettings):
1818
TEMPLATE_DEBUG = False
1919
ES_PAGE_IGNORE_SIGNALS = False
2020
ELASTICSEARCH_DSL_AUTOSYNC = False
21+
ELASTICSEARCH_DSL_AUTO_REFRESH = False
2122

2223
@property
2324
def ES_INDEXES(self): # noqa - avoid pep8 N802

0 commit comments

Comments
 (0)