File tree 3 files changed +16
-4
lines changed
3 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ class Meta(object):
59
59
title = fields .TextField (attr = 'processed_json.title' )
60
60
headers = fields .TextField (attr = 'processed_json.headers' )
61
61
content = fields .TextField (attr = 'processed_json.content' )
62
- path = fields .TextField (attr = 'processed_json.path' )
62
+ path = fields .KeywordField (attr = 'processed_json.path' )
63
63
64
64
# Fields to perform search with weight
65
65
search_fields = ['title^10' , 'headers^5' , 'content' ]
Original file line number Diff line number Diff line change @@ -343,18 +343,29 @@ def USE_PROMOS(self): # noqa
343
343
ES_INDEXES = {
344
344
'project' : {
345
345
'name' : 'project_index' ,
346
- 'settings' : {'number_of_shards' : 5 ,
346
+ # We do not have much data in the project index, therefore only 1 shard with
347
+ # 1 replica is appropriate project index
348
+ 'settings' : {'number_of_shards' : 1 ,
347
349
'number_of_replicas' : 1
348
350
}
349
351
},
350
352
'page' : {
351
353
'name' : 'page_index' ,
352
354
'settings' : {
353
- 'number_of_shards' : 5 ,
354
- 'number_of_replicas' : 1 ,
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.
359
+ 'number_of_shards' : 3 ,
360
+ 'number_of_replicas' : 3 ,
361
+ "index" : {
362
+ "sort.field" : ["project" , "version" ]
363
+ }
355
364
}
356
365
},
357
366
}
367
+ # Disable auto refresh for increasing index performance
368
+ ELASTICSEARCH_DSL_AUTO_REFRESH = False
358
369
359
370
ALLOWED_HOSTS = ['*' ]
360
371
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ class CommunityTestSettings(CommunityDevSettings):
18
18
TEMPLATE_DEBUG = False
19
19
ES_PAGE_IGNORE_SIGNALS = False
20
20
ELASTICSEARCH_DSL_AUTOSYNC = False
21
+ ELASTICSEARCH_DSL_AUTO_REFRESH = True
21
22
22
23
@property
23
24
def ES_INDEXES (self ): # noqa - avoid pep8 N802
You can’t perform that action at this time.
0 commit comments