<fields oils_persist:primary="name">
<field reporter:label="Name" name="name" reporter:datatype="text"/>
<field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
- <field reporter:label="Bouyant?" name="bouyant" reporter:datatype="bool" />
+ <field reporter:label="Buoyant?" name="buoyant" reporter:datatype="bool" />
<field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
<field reporter:label="Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
</fields>
CREATE TABLE config.metabib_class (
name TEXT PRIMARY KEY,
label TEXT NOT NULL UNIQUE,
- bouyant BOOL DEFAULT FALSE NOT NULL,
+ buoyant BOOL DEFAULT FALSE NOT NULL,
restrict BOOL DEFAULT FALSE NOT NULL
);
) RETURNS TABLE (
value TEXT, -- plain
field INTEGER,
- bouyant_and_class_match BOOL,
+ buoyant_and_class_match BOOL,
field_match BOOL,
field_weight INTEGER,
rank REAL,
- bouyant BOOL,
+ buoyant BOOL,
match TEXT -- marked up
) AS $func$
DECLARE
RETURN QUERY EXECUTE 'SELECT *, TS_HEADLINE(value, $7, $3) FROM (SELECT DISTINCT
mbe.value,
cmf.id,
- cmc.bouyant AND _registered.field_class IS NOT NULL,
+ cmc.buoyant AND _registered.field_class IS NOT NULL,
_registered.field = cmf.id,
cmf.weight,
TS_RANK_CD(mbe.index_vector, $1, $6),
- cmc.bouyant
+ cmc.buoyant
FROM metabib.browse_entry_def_map mbedm
JOIN metabib.browse_entry mbe ON (mbe.id = mbedm.entry)
JOIN config.metabib_field cmf ON (cmf.id = mbedm.def)
;
-- sort order:
- -- bouyant AND chosen class = match class
+ -- buoyant AND chosen class = match class
-- chosen field = match field
-- field weight
-- rank
- -- bouyancy
+ -- buoyancy
-- value itself
END;
$$ LANGUAGE PLPGSQL;
+-- Definition of OUT parameters changes, so must drop first
+DROP FUNCTION IF EXISTS metabib.suggest_browse_entries (TEXT, TEXT, TEXT, INTEGER, INTEGER, INTEGER);
+
CREATE OR REPLACE
FUNCTION metabib.suggest_browse_entries(
raw_query_text TEXT, -- actually typed by humans at the UI level
) RETURNS TABLE (
value TEXT, -- plain
field INTEGER,
- bouyant_and_class_match BOOL,
+ buoyant_and_class_match BOOL,
field_match BOOL,
field_weight INTEGER,
rank REAL,
- bouyant BOOL,
+ buoyant BOOL,
match TEXT -- marked up
) AS $func$
DECLARE
RETURN QUERY EXECUTE 'SELECT *, TS_HEADLINE(value, $7, $3) FROM (SELECT DISTINCT
mbe.value,
cmf.id,
- cmc.bouyant AND _registered.field_class IS NOT NULL,
+ cmc.buoyant AND _registered.field_class IS NOT NULL,
_registered.field = cmf.id,
cmf.weight,
TS_RANK_CD(mbe.index_vector, $1, $6),
- cmc.bouyant
+ cmc.buoyant
FROM metabib.browse_entry_def_map mbedm
JOIN metabib.browse_entry mbe ON (mbe.id = mbedm.entry)
JOIN config.metabib_field cmf ON (cmf.id = mbedm.def)
;
-- sort order:
- -- bouyant AND chosen class = match class
+ -- buoyant AND chosen class = match class
-- chosen field = match field
-- field weight
-- rank
- -- bouyancy
+ -- buoyancy
-- value itself
END;