aumento de velocidad y cambios en el tema de noticias relacionadas
This commit is contained in:
parent
3eca832c1a
commit
95adc07f37
9 changed files with 275 additions and 97 deletions
|
|
@ -93,17 +93,21 @@ def noticia():
|
|||
cur.execute(
|
||||
"""
|
||||
SELECT
|
||||
n2.id,
|
||||
n2.url,
|
||||
n2.titulo,
|
||||
n2.titulo AS titulo_original,
|
||||
n2.fecha,
|
||||
n2.imagen_url,
|
||||
n2.fuente_nombre,
|
||||
rn.score,
|
||||
t2.titulo_trad,
|
||||
t2.id AS related_tr_id
|
||||
t2.id AS traduccion_id,
|
||||
c.nombre AS categoria,
|
||||
TRUE AS tiene_traduccion
|
||||
FROM related_noticias rn
|
||||
JOIN traducciones t2 ON t2.id = rn.related_traduccion_id
|
||||
JOIN noticias n2 ON n2.id = t2.noticia_id
|
||||
LEFT JOIN categorias c ON c.id = n2.categoria_id
|
||||
WHERE rn.traduccion_id = %s
|
||||
ORDER BY rn.score DESC
|
||||
LIMIT 8;
|
||||
|
|
|
|||
|
|
@ -42,7 +42,8 @@ def search():
|
|||
semantic_results = semantic_search(
|
||||
query=q,
|
||||
limit=max_qdrant_results,
|
||||
score_threshold=0.3 # Umbral más bajo para capturar más resultados
|
||||
score_threshold=0.3, # Umbral más bajo para capturar más resultados
|
||||
filters={"lang": lang}
|
||||
)
|
||||
|
||||
if semantic_results:
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@ def aggregate_normalized_entities(rows, entity_type='persona'):
|
|||
|
||||
|
||||
@stats_bp.route("/")
|
||||
@cached(ttl_seconds=600, prefix="stats_index")
|
||||
def index():
|
||||
"""Stats dashboard page."""
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue