fix a problem where we got too many mbedm rows
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Tue, 20 Dec 2011 17:05:38 +0000 (12:05 -0500)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Mon, 23 Jan 2012 17:26:57 +0000 (12:26 -0500)
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/sql/Pg/030.schema.metabib.sql
Open-ILS/src/sql/Pg/upgrade/YYYY.schema.bib_autosuggest.sql

index 37e23be..6e689d4 100644 (file)
@@ -332,10 +332,6 @@ BEGIN
     -- Loop over the indexing entries
     FOR idx IN SELECT * FROM config.metabib_field ORDER BY format LOOP
 
-        output_row.facet_field = idx.facet_field;
-        output_row.suggest_field = idx.suggest_field;
-        output_row.search_field = idx.search_field;
-
         SELECT INTO xfrm * from config.xml_transform WHERE name = idx.format;
 
         -- See if we can skip the XSLT ... it's expensive
@@ -395,7 +391,9 @@ BEGIN
                 output_row.source = rid;
                 output_row.value = BTRIM(REGEXP_REPLACE(suggest_text, E'\\s+', ' ', 'g'));
 
+                output_row.suggest_field = TRUE;
                 RETURN NEXT output_row;
+                output_row.suggest_field = FALSE;
             END IF;
 
             -- insert raw node text for faceting
@@ -412,7 +410,9 @@ BEGIN
                 output_row.source = rid;
                 output_row.value = BTRIM(REGEXP_REPLACE(facet_text, E'\\s+', ' ', 'g'));
 
+                output_row.facet_field = TRUE;
                 RETURN NEXT output_row;
+                output_row.facet_field = FALSE;
             END IF;
 
         END LOOP;
@@ -426,6 +426,7 @@ BEGIN
             output_row.source = rid;
             output_row.value = BTRIM(REGEXP_REPLACE(raw_text, E'\\s+', ' ', 'g'));
 
+            output_row.search_field = TRUE;
             RETURN NEXT output_row;
         END IF;
 
index 502e88e..488b68d 100644 (file)
@@ -90,10 +90,6 @@ BEGIN
     -- Loop over the indexing entries
     FOR idx IN SELECT * FROM config.metabib_field ORDER BY format LOOP
 
-        output_row.facet_field = idx.facet_field;
-        output_row.suggest_field = idx.suggest_field;
-        output_row.search_field = idx.search_field;
-
         SELECT INTO xfrm * from config.xml_transform WHERE name = idx.format;
 
         -- See if we can skip the XSLT ... it's expensive
@@ -153,7 +149,9 @@ BEGIN
                 output_row.source = rid;
                 output_row.value = BTRIM(REGEXP_REPLACE(suggest_text, E'\\s+', ' ', 'g'));
 
+                output_row.suggest_field = TRUE;
                 RETURN NEXT output_row;
+                output_row.suggest_field = FALSE;
             END IF;
 
             -- insert raw node text for faceting
@@ -170,7 +168,9 @@ BEGIN
                 output_row.source = rid;
                 output_row.value = BTRIM(REGEXP_REPLACE(facet_text, E'\\s+', ' ', 'g'));
 
+                output_row.facet_field = TRUE;
                 RETURN NEXT output_row;
+                output_row.facet_field = FALSE;
             END IF;
 
         END LOOP;
@@ -184,6 +184,7 @@ BEGIN
             output_row.source = rid;
             output_row.value = BTRIM(REGEXP_REPLACE(raw_text, E'\\s+', ' ', 'g'));
 
+            output_row.search_field = TRUE;
             RETURN NEXT output_row;
         END IF;