Skip to content

Commit 10a6590

Browse files
committed
adding comments
1 parent 40865ae commit 10a6590

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

readthedocs/search/documents.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class Meta(object):
5959
title = fields.TextField(attr='processed_json.title')
6060
headers = fields.TextField(attr='processed_json.headers')
6161
content = fields.TextField(attr='processed_json.content')
62-
path = fields.TextField(attr='processed_json.path')
62+
path = fields.KeywordField(attr='processed_json.path')
6363

6464
# Fields to perform search with weight
6565
search_fields = ['title^10', 'headers^5', 'content']

readthedocs/settings/base.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,13 +343,19 @@ def USE_PROMOS(self): # noqa
343343
ES_INDEXES = {
344344
'project': {
345345
'name': 'project_index',
346+
# We do not have much data in the project node, therefore only 1 shard with
347+
# 1 replica is appropriate project index
346348
'settings': {'number_of_shards': 1,
347349
'number_of_replicas': 1
348350
}
349351
},
350352
'page': {
351353
'name': 'page_index',
352354
'settings': {
355+
# We have 3 nodes, therefore having 3 shards and each one having 3 replica
356+
# will be good fit for our infrastructure. So all the 9(3*3) shards will be
357+
# allocated to 3 nodes. Therefore, if one nodes get failed, the data will be
358+
# inside other nodes and Elasticsearch can serve properly.
353359
'number_of_shards': 3,
354360
'number_of_replicas': 3,
355361
"index": {

0 commit comments

Comments
 (0)