Update app.py
Browse files
app.py
CHANGED
|
@@ -86,144 +86,147 @@ def search_stf(query: str):
|
|
| 86 |
"query_string": {
|
| 87 |
"query": query,
|
| 88 |
"default_operator": "AND",
|
| 89 |
-
"fields":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
"fuzziness": "AUTO:4,7"
|
| 91 |
}
|
| 92 |
},
|
| 93 |
"_source": ["id", "titulo", "ementa_texto", "processo_codigo_completo", "relator_processo_nome", "orgao_julgador", "julgamento_data", "inteiro_teor_url"],
|
| 94 |
|
| 95 |
-
"aggs":{
|
| 96 |
-
"base_agg":{
|
| 97 |
-
"filters":{
|
| 98 |
-
"filters":{
|
| 99 |
-
"acordaos":{
|
| 100 |
-
"match":{
|
| 101 |
-
"base":"acordaos"
|
| 102 |
-
}
|
| 103 |
-
},
|
| 104 |
-
"sumulas":{
|
| 105 |
-
"match":{
|
| 106 |
-
"base":"sumulas"
|
| 107 |
-
}
|
| 108 |
-
},
|
| 109 |
-
"decisoes":{
|
| 110 |
-
"match":{
|
| 111 |
-
"base":"decisoes"
|
| 112 |
-
}
|
| 113 |
-
},
|
| 114 |
-
"informativos":{
|
| 115 |
-
"match":{
|
| 116 |
-
"base":"novo_informativo"
|
| 117 |
-
}
|
| 118 |
-
}
|
| 119 |
-
}
|
| 120 |
-
}
|
| 121 |
-
},
|
| 122 |
-
"is_decisao_presidencia_agg":{
|
| 123 |
-
"filters":{
|
| 124 |
-
"filters":{
|
| 125 |
-
"true":{
|
| 126 |
-
"match":{
|
| 127 |
-
"is_decisao_presidencia":true
|
| 128 |
-
}
|
| 129 |
-
},
|
| 130 |
-
"false":{
|
| 131 |
-
"match":{
|
| 132 |
-
"is_decisao_presidencia":false
|
| 133 |
-
}
|
| 134 |
-
}
|
| 135 |
-
}
|
| 136 |
-
}
|
| 137 |
-
},
|
| 138 |
-
"orgao_julgador_agg":{
|
| 139 |
-
"aggs":{
|
| 140 |
-
"orgao_julgador_agg":{
|
| 141 |
-
"terms":{
|
| 142 |
-
"field":"orgao_julgador.keyword",
|
| 143 |
-
"size":200,
|
| 144 |
-
"execution_hint":"map"
|
| 145 |
-
}
|
| 146 |
-
}
|
| 147 |
-
},
|
| 148 |
-
"filter":{
|
| 149 |
-
"bool":{
|
| 150 |
-
"must":[
|
| 151 |
-
{
|
| 152 |
-
"term":{
|
| 153 |
-
"base":"decisoes"
|
| 154 |
-
}
|
| 155 |
-
}
|
| 156 |
-
]
|
| 157 |
-
}
|
| 158 |
-
}
|
| 159 |
-
},
|
| 160 |
-
"ministro_facet_agg":{
|
| 161 |
-
"aggs":{
|
| 162 |
-
"ministro_facet_agg":{
|
| 163 |
-
"terms":{
|
| 164 |
-
"field":"ministro_facet.keyword",
|
| 165 |
-
"size":200,
|
| 166 |
-
"execution_hint":"map"
|
| 167 |
-
}
|
| 168 |
-
}
|
| 169 |
-
},
|
| 170 |
-
"filter":{
|
| 171 |
-
"bool":{
|
| 172 |
-
"must":[
|
| 173 |
-
{
|
| 174 |
-
"term":{
|
| 175 |
-
"base":"decisoes"
|
| 176 |
-
}
|
| 177 |
-
}
|
| 178 |
-
]
|
| 179 |
-
}
|
| 180 |
-
}
|
| 181 |
-
},
|
| 182 |
-
"processo_classe_processual_unificada_classe_sigla_agg":{
|
| 183 |
-
"aggs":{
|
| 184 |
-
"processo_classe_processual_unificada_classe_sigla_agg":{
|
| 185 |
-
"terms":{
|
| 186 |
-
"field":"processo_classe_processual_unificada_classe_sigla.keyword",
|
| 187 |
-
"size":200,
|
| 188 |
-
"execution_hint":"map"
|
| 189 |
-
}
|
| 190 |
-
}
|
| 191 |
-
},
|
| 192 |
-
"filter":{
|
| 193 |
-
"bool":{
|
| 194 |
-
"must":[
|
| 195 |
-
{
|
| 196 |
-
"term":{
|
| 197 |
-
"base":"decisoes"
|
| 198 |
-
}
|
| 199 |
-
}
|
| 200 |
-
]
|
| 201 |
-
}
|
| 202 |
-
}
|
| 203 |
-
},
|
| 204 |
-
"procedencia_geografica_uf_sigla_agg":{
|
| 205 |
-
"aggs":{
|
| 206 |
-
"procedencia_geografica_uf_sigla_agg":{
|
| 207 |
-
"terms":{
|
| 208 |
-
"field":"procedencia_geografica_uf_sigla",
|
| 209 |
-
"size":200,
|
| 210 |
-
"execution_hint":"map"
|
| 211 |
-
}
|
| 212 |
-
}
|
| 213 |
-
},
|
| 214 |
-
"filter":{
|
| 215 |
-
"bool":{
|
| 216 |
-
"must":[
|
| 217 |
-
{
|
| 218 |
-
"term":{
|
| 219 |
-
"base":"decisoes"
|
| 220 |
-
}
|
| 221 |
-
}
|
| 222 |
-
]
|
| 223 |
-
}
|
| 224 |
-
}
|
| 225 |
-
}
|
| 226 |
-
},
|
| 227 |
"size": 20,
|
| 228 |
"track_total_hits": True
|
| 229 |
}
|
|
|
|
| 86 |
"query_string": {
|
| 87 |
"query": query,
|
| 88 |
"default_operator": "AND",
|
| 89 |
+
"fields":{
|
| 90 |
+
"ementa_texto":{
|
| 91 |
+
"fragment_size":24000,
|
| 92 |
+
"matched_fields":[
|
| 93 |
+
"ementa_texto.standard"
|
| 94 |
+
],
|
| 95 |
+
"type":"fvh"
|
| 96 |
+
},
|
| 97 |
+
"sumula_texto":{
|
| 98 |
+
"number_of_fragments":0,
|
| 99 |
+
"matched_fields":[
|
| 100 |
+
"sumula_texto.standard"
|
| 101 |
+
],
|
| 102 |
+
"type":"fvh"
|
| 103 |
+
},
|
| 104 |
+
"materia_noticia":{
|
| 105 |
+
"matched_fields":[
|
| 106 |
+
"materia_noticia.standard"
|
| 107 |
+
],
|
| 108 |
+
"type":"fvh"
|
| 109 |
+
},
|
| 110 |
+
"titulo_noticia":{
|
| 111 |
+
"matched_fields":[
|
| 112 |
+
"titulo_noticia.standard"
|
| 113 |
+
],
|
| 114 |
+
"type":"fvh"
|
| 115 |
+
},
|
| 116 |
+
"resumo_noticia":{
|
| 117 |
+
"fragment_size":5000,
|
| 118 |
+
"matched_fields":[
|
| 119 |
+
"resumo_noticia.standard"
|
| 120 |
+
],
|
| 121 |
+
"type":"fvh"
|
| 122 |
+
},
|
| 123 |
+
"conteudo_noticia":{
|
| 124 |
+
"fragment_size":50000,
|
| 125 |
+
"matched_fields":[
|
| 126 |
+
"conteudo_noticia.standard"
|
| 127 |
+
],
|
| 128 |
+
"type":"fvh"
|
| 129 |
+
},
|
| 130 |
+
"acordao_ata":{
|
| 131 |
+
"fragment_size":600,
|
| 132 |
+
"matched_fields":[
|
| 133 |
+
"acordao_ata.standard"
|
| 134 |
+
],
|
| 135 |
+
"type":"fvh"
|
| 136 |
+
},
|
| 137 |
+
"decisao_texto":{
|
| 138 |
+
"fragment_size":1200,
|
| 139 |
+
"matched_fields":[
|
| 140 |
+
"decisao_texto.standard"
|
| 141 |
+
],
|
| 142 |
+
"type":"fvh"
|
| 143 |
+
},
|
| 144 |
+
"documental_tese_texto":{
|
| 145 |
+
"fragment_size":2000,
|
| 146 |
+
"matched_fields":[
|
| 147 |
+
"documental_tese_texto.standard"
|
| 148 |
+
],
|
| 149 |
+
"type":"fvh"
|
| 150 |
+
},
|
| 151 |
+
"documental_tese_tema_texto":{
|
| 152 |
+
"fragment_size":2000,
|
| 153 |
+
"matched_fields":[
|
| 154 |
+
"documental_tese_tema_texto.standard"
|
| 155 |
+
],
|
| 156 |
+
"type":"fvh"
|
| 157 |
+
},
|
| 158 |
+
"documental_observacao_texto":{
|
| 159 |
+
"matched_fields":[
|
| 160 |
+
"documental_observacao_texto.standard"
|
| 161 |
+
],
|
| 162 |
+
"type":"fvh"
|
| 163 |
+
},
|
| 164 |
+
"documental_indexacao_texto":{
|
| 165 |
+
"matched_fields":[
|
| 166 |
+
"documental_indexacao_texto.standard"
|
| 167 |
+
],
|
| 168 |
+
"type":"fvh"
|
| 169 |
+
},
|
| 170 |
+
"documental_legislacao_citada_texto":{
|
| 171 |
+
"matched_fields":[
|
| 172 |
+
"documental_legislacao_citada_texto.standard"
|
| 173 |
+
],
|
| 174 |
+
"type":"fvh"
|
| 175 |
+
},
|
| 176 |
+
"documental_jurisprudencia_citada_texto":{
|
| 177 |
+
"matched_fields":[
|
| 178 |
+
"documental_jurisprudencia_citada_texto.standard"
|
| 179 |
+
],
|
| 180 |
+
"type":"fvh"
|
| 181 |
+
},
|
| 182 |
+
"documental_doutrina_texto":{
|
| 183 |
+
"matched_fields":[
|
| 184 |
+
"documental_doutrina_texto.standard"
|
| 185 |
+
],
|
| 186 |
+
"type":"fvh"
|
| 187 |
+
},
|
| 188 |
+
"partes_lista_texto":{
|
| 189 |
+
"matched_fields":[
|
| 190 |
+
"partes_lista_texto.standard"
|
| 191 |
+
],
|
| 192 |
+
"type":"fvh"
|
| 193 |
+
},
|
| 194 |
+
"documental_publicacao_lista_texto":{
|
| 195 |
+
"matched_fields":[
|
| 196 |
+
"documental_publicacao_lista_texto.standard"
|
| 197 |
+
],
|
| 198 |
+
"type":"fvh"
|
| 199 |
+
},
|
| 200 |
+
"documental_acordao_mesmo_sentido_lista_texto":{
|
| 201 |
+
"matched_fields":[
|
| 202 |
+
"documental_acordao_mesmo_sentido_lista_texto.standard"
|
| 203 |
+
],
|
| 204 |
+
"type":"fvh"
|
| 205 |
+
},
|
| 206 |
+
"documental_decisao_mesmo_sentido_lista_texto":{
|
| 207 |
+
"matched_fields":[
|
| 208 |
+
"documental_decisao_mesmo_sentido_lista_texto.standard"
|
| 209 |
+
],
|
| 210 |
+
"type":"fvh"
|
| 211 |
+
},
|
| 212 |
+
"processo_precedente_texto":{
|
| 213 |
+
"matched_fields":[
|
| 214 |
+
"processo_precedente_texto.standard"
|
| 215 |
+
],
|
| 216 |
+
"type":"fvh"
|
| 217 |
+
},
|
| 218 |
+
"procedencia_geografica_completo":{
|
| 219 |
+
"matched_fields":[
|
| 220 |
+
"procedencia_geografica_completo.standard"
|
| 221 |
+
],
|
| 222 |
+
"type":"fvh"
|
| 223 |
+
}
|
| 224 |
+
},
|
| 225 |
"fuzziness": "AUTO:4,7"
|
| 226 |
}
|
| 227 |
},
|
| 228 |
"_source": ["id", "titulo", "ementa_texto", "processo_codigo_completo", "relator_processo_nome", "orgao_julgador", "julgamento_data", "inteiro_teor_url"],
|
| 229 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 230 |
"size": 20,
|
| 231 |
"track_total_hits": True
|
| 232 |
}
|