Fix ES Settings

This commit is contained in:
simon987 2019-01-13 13:52:49 -05:00
parent 7f857d641f
commit dd3775cecd
2 changed files with 19 additions and 2 deletions

View File

@ -71,6 +71,21 @@ server {
...
}
```
* Configure Elasticsearch
```
PUT _template/default
{
"index_patterns": ["*"],
"order": -1,
"settings": {
"number_of_shards": "50",
"number_of_replicas": "0",
"codec" : "best_compression",
"routing_partition_size" : 5
}
}
```
* Start uwsgi:
```bash
uwsgi od-database.ini

View File

@ -83,7 +83,7 @@ class ElasticSearchEngine(SearchEngine):
"type": "nGram", "min_gram": 3, "max_gram": 3
}
}
}}, index=self.index_name)
}}, index=self.index_name, request_timeout=60)
self.es.indices.put_settings(body={
"analysis": {
"analyzer": {
@ -103,7 +103,9 @@ class ElasticSearchEngine(SearchEngine):
"size": {"type": "long"},
"website_id": {"type": "integer"},
"ext": {"type": "keyword"},
}}, doc_type="file", index=self.index_name)
},
"_routing": {"required": True}
}, doc_type="file", index=self.index_name, request_timeout=60)
self.es.indices.open(index=self.index_name)