arruma o processo de busca textual nos diarios

This commit is contained in:
root
2025-03-14 17:36:14 +01:00
parent 8d1f6feeaf
commit f2e5cd73b7
15 changed files with 650 additions and 645 deletions

View File

@ -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'
]
}
}
}
}