Browse Source

Adiciona campos extra aos documentos (#2941)

pull/2904/head
Edward 6 years ago
committed by GitHub
parent
commit
6a04c08cd6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      sapl/base/search_indexes.py
  2. 2
      solr/sapl_configset/conf/managed-schema
  3. BIN
      solr/sapl_configset/conf/saplconfigset.zip

6
sapl/base/search_indexes.py

@ -8,7 +8,7 @@ from django.db.models.functions import Concat
from django.template import loader from django.template import loader
from haystack import connections from haystack import connections
from haystack.constants import Indexable from haystack.constants import Indexable
from haystack.fields import CharField, DateTimeField from haystack.fields import CharField, DateTimeField, IntegerField
from haystack.utils import get_model_ct_tuple from haystack.utils import get_model_ct_tuple
from sapl.compilacao.models import (STATUS_TA_IMMUTABLE_PUBLIC, from sapl.compilacao.models import (STATUS_TA_IMMUTABLE_PUBLIC,
@ -145,6 +145,8 @@ class DocumentoAcessorioIndex(CelerySearchIndex, Indexable):
class NormaJuridicaIndex(DocumentoAcessorioIndex): class NormaJuridicaIndex(DocumentoAcessorioIndex):
model = NormaJuridica model = NormaJuridica
data = DateTimeField(model_attr='data', null=True) data = DateTimeField(model_attr='data', null=True)
tipo = CharField(model_attr='tipo__sigla')
ano = IntegerField(model_attr='ano')
text = TextExtractField( text = TextExtractField(
document=True, use_template=True, document=True, use_template=True,
model_attr=( model_attr=(
@ -159,6 +161,8 @@ class NormaJuridicaIndex(DocumentoAcessorioIndex):
class MateriaLegislativaIndex(DocumentoAcessorioIndex): class MateriaLegislativaIndex(DocumentoAcessorioIndex):
model = MateriaLegislativa model = MateriaLegislativa
tipo = CharField(model_attr='tipo__sigla')
ano = IntegerField(model_attr='ano')
data = DateTimeField(model_attr='data_apresentacao') data = DateTimeField(model_attr='data_apresentacao')
text = TextExtractField( text = TextExtractField(
document=True, use_template=True, document=True, use_template=True,

2
solr/sapl_configset/conf/managed-schema

@ -120,6 +120,8 @@
<field name="django_ct" type="string" indexed="true" stored="true" multiValued="false"/> <field name="django_ct" type="string" indexed="true" stored="true" multiValued="false"/>
<field name="django_id" type="string" indexed="true" stored="true" multiValued="false"/> <field name="django_id" type="string" indexed="true" stored="true" multiValued="false"/>
<field name="text" type="text_pt" indexed="true" stored="true" multiValued="false" /> <field name="text" type="text_pt" indexed="true" stored="true" multiValued="false" />
<field name="tipo" type="string" indexed="true" stored="true" multiValued="false" docValues="true" />
<field name="ano" type="pint" required="false" indexed="true" stored="true" multiValued="false" docValues="true" />
<field name="data" type="pdate" required="false" indexed="true" stored="true" multiValued="false" docValues="true" /> <field name="data" type="pdate" required="false" indexed="true" stored="true" multiValued="false" docValues="true" />
<field name="last_update" type="pdate" indexed="true" stored="true" default="NOW" docValues="true" /> <field name="last_update" type="pdate" indexed="true" stored="true" default="NOW" docValues="true" />

BIN
solr/sapl_configset/conf/saplconfigset.zip

Binary file not shown.
Loading…
Cancel
Save