mirror of
https://github.com/simon987/od-database.git
synced 2025-04-10 14:06:45 +00:00
Fix ES Settings
This commit is contained in:
parent
7f857d641f
commit
dd3775cecd
15
README.md
15
README.md
@ -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
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user