mirror of
https://github.com/simon987/od-database.git
synced 2025-04-19 18:36:44 +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:
|
* Start uwsgi:
|
||||||
```bash
|
```bash
|
||||||
uwsgi od-database.ini
|
uwsgi od-database.ini
|
||||||
|
@ -83,7 +83,7 @@ class ElasticSearchEngine(SearchEngine):
|
|||||||
"type": "nGram", "min_gram": 3, "max_gram": 3
|
"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={
|
self.es.indices.put_settings(body={
|
||||||
"analysis": {
|
"analysis": {
|
||||||
"analyzer": {
|
"analyzer": {
|
||||||
@ -103,7 +103,9 @@ class ElasticSearchEngine(SearchEngine):
|
|||||||
"size": {"type": "long"},
|
"size": {"type": "long"},
|
||||||
"website_id": {"type": "integer"},
|
"website_id": {"type": "integer"},
|
||||||
"ext": {"type": "keyword"},
|
"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)
|
self.es.indices.open(index=self.index_name)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user