From 6369d52028856a3638f4e34b93e6b9802e01ffb4 Mon Sep 17 00:00:00 2001 From: Ludmila Marian Date: Tue, 1 Sep 2015 15:22:26 +0200 Subject: [PATCH] BibIndex: fix computation of records to be indexed * FIX The function find_affected_records_for_index() should calculate the affected records based on the `recIDs` argument, and not add additional records to the affected ones. Signed-off-by: Ludmila Marian --- modules/bibindex/lib/bibindex_engine.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/bibindex/lib/bibindex_engine.py b/modules/bibindex/lib/bibindex_engine.py index 7d7333af70..4489c76179 100644 --- a/modules/bibindex/lib/bibindex_engine.py +++ b/modules/bibindex/lib/bibindex_engine.py @@ -544,8 +544,10 @@ def _should_reindex_for_revision(index_name, revision_date): res = run_sql("""SELECT bibrec.id,modification_date,'' FROM bibrec, hstRECORD WHERE modification_date>%s + AND id_bibrec BETWEEN %s AND %s AND bibrec.id=id_bibrec - AND (SELECT COUNT(*) FROM hstRECORD WHERE id_bibrec=bibrec.id)=1""", (min_last_updated,)) + AND (SELECT COUNT(*) FROM hstRECORD WHERE id_bibrec=bibrec.id)=1""", + (recIDs_range[0], recIDs_range[1], min_last_updated,)) if res: recIDs_info.extend(res)