arruma o processo de busca textual nos diarios
This commit is contained in:
@ -84,6 +84,7 @@ LOCAL_APPS = [
|
||||
"diários_oficiais_alems.users",
|
||||
"diarios",
|
||||
"django_elasticsearch_dsl",
|
||||
"rest_framework",
|
||||
]
|
||||
# https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps
|
||||
INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS
|
||||
@ -293,3 +294,36 @@ ELASTICSEARCH_DSL = {
|
||||
"default": {"hosts": "http://elasticsearch:9200"}, # same as above
|
||||
}
|
||||
ELASTICSEARCH_HOSTS = "http://elasticsearch:9200"
|
||||
|
||||
ELASTICSEARCH_INDEX_SETTINGS = {
|
||||
'number_of_shards': 1,
|
||||
'number_of_replicas': 0,
|
||||
'analysis': {
|
||||
'filter': {
|
||||
'portuguese_stop': {
|
||||
'type': 'stop',
|
||||
'stopwords': '_portuguese_'
|
||||
},
|
||||
'portuguese_stemmer': {
|
||||
'type': 'stemmer',
|
||||
'language': 'portuguese'
|
||||
},
|
||||
'synonym_filter': {
|
||||
'type': 'synonym',
|
||||
'synonyms_path': 'analysis/sinonimos.txt',
|
||||
}
|
||||
},
|
||||
'analyzer': {
|
||||
'pt_analyzer': {
|
||||
'tokenizer': 'standard',
|
||||
'filter': [
|
||||
'lowercase',
|
||||
'portuguese_stop',
|
||||
'portuguese_stemmer',
|
||||
'synonym_filter'
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user