Rows in metabib.title_field_entry, subject_field_entry,
series_field_entry, and author_field_entry are doubled or tripled due to
bad logic in biblio.extract_metabib_field_entry. This results in these
tables being 2 or more times their correct size.
This was introduced in 2.2.0 when the logic for browse_field and
facet_field were added to biblio.extract_metabib_field_entry. 2.1 is not
affected.
The duplicates are caused when biblio.extract_metabib_field_entry
returns TRUE in the search_field column for all rows even if they should
just be facet_field or browse_field after the first search_field value
is returned.
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
output_row metabib.field_entry_template%ROWTYPE;
BEGIN
+ -- Start out with no field-use bools set
+ output_row.browse_field = FALSE;
+ output_row.facet_field = FALSE;
+ output_row.search_field = FALSE;
+
-- Get the record
SELECT INTO bib * FROM biblio.record_entry WHERE id = rid;
output_row.search_field = TRUE;
RETURN NEXT output_row;
+ output_row.search_field = FALSE;
END IF;
END LOOP;