diff --git a/sapl/base/search_indexes.py b/sapl/base/search_indexes.py index e925de8c8..9c11f304f 100644 --- a/sapl/base/search_indexes.py +++ b/sapl/base/search_indexes.py @@ -105,6 +105,9 @@ class TextExtractField(CharField): r += list(filter(lambda x: x.strip(), dispositivos)) return ' '.join(r) + def string_extractor(self, value): + return value + def extract_data(self, obj): data = '' @@ -135,7 +138,11 @@ class DocumentoAcessorioIndex(SearchIndex, Indexable): model = DocumentoAcessorio text = TextExtractField( document=True, use_template=True, - model_attr=(('arquivo', 'file_extractor'), ) + model_attr=( + ('arquivo', 'file_extractor'), + ('ementa', 'string_extractor'), + ('indexacao', 'string_extractor'), + ) ) def get_model(self): @@ -154,7 +161,10 @@ class NormaJuridicaIndex(DocumentoAcessorioIndex): document=True, use_template=True, model_attr=( ('texto_integral', 'file_extractor'), - ('texto_articulado', 'ta_extractor') + ('texto_articulado', 'ta_extractor'), + ('ementa', 'string_extractor'), + ('indexacao', 'string_extractor'), + ('observacao', 'string_extractor'), ) ) @@ -165,6 +175,9 @@ class MateriaLegislativaIndex(DocumentoAcessorioIndex): document=True, use_template=True, model_attr=( ('texto_original', 'file_extractor'), - ('texto_articulado', 'ta_extractor') + ('texto_articulado', 'ta_extractor'), + ('ementa', 'string_extractor'), + ('indexacao', 'string_extractor'), + ('observacao', 'string_extractor'), ) ) diff --git a/sapl/templates/search/search.html b/sapl/templates/search/search.html index e3b430f40..f55688255 100644 --- a/sapl/templates/search/search.html +++ b/sapl/templates/search/search.html @@ -51,6 +51,7 @@ {% if result.object|search_get_model == 'm' %}

Matéria Legislativa: {{ result.object }}
+ {{result.object.ementa}}
{% if result.object.texto_original %} Texto Original: Clique aqui
@@ -65,6 +66,7 @@ {% elif result.object|search_get_model == 'd' %}

Documento Acessório: {{ result.object }}
+ {{result.object.ementa}}
{% if result.object.arquivo %} Texto Original: Clique aqui
{% else %} @@ -75,6 +77,7 @@ {% elif result.object|search_get_model == 'n' %}

Norma Jurídica: {{ result.object }}
+ {{result.object.ementa}}
{% if result.object.texto_integral %} Texto Original: Clique aqui
{% endif %}