CREATE INDEX metabib_browse_entry_index_vector_idx ON metabib.browse_entry USING GIST (index_vector);
CREATE TRIGGER metabib_browse_entry_fti_trigger
BEFORE INSERT OR UPDATE ON metabib.browse_entry
- FOR EACH ROW EXECUTE PROCEDURE oils_tsearch2('default');
+ FOR EACH ROW EXECUTE PROCEDURE oils_tsearch2('keyword');
CREATE TABLE metabib.browse_entry_def_map (
END IF;
IF ind_data.browse_field THEN
+ -- A caveat about this SELECT: this should take care of replacing
+ -- old mbe rows when data changes, but not if normalization (by
+ -- which I mean specifically the output of
+ -- evergreen.oils_tsearch2()) changes. It may or may not be
+ -- expensive to add a comparison of index_vector to index_vector
+ -- to the WHERE clause below.
SELECT INTO mbe_row * FROM metabib.browse_entry WHERE value = ind_data.value;
IF FOUND THEN
mbe_id := mbe_row.id;
}
function autoSuggestInit() {
- /* For the "style" argument to the constructor below, IE 8 hates it if
- * we supply dojo.attr("search_box", "style") as the value, which worked
- * nicely in Google Chrome and Firefox. Filtering the "font" key/value
- * pair out of that object gets IE not to throw an error, but even then
- * the result is oddly ugly borders. So for now we're sadly hardcoding
- * style. */
var widg = new openils.widget.AutoSuggest(
{
"storeArgs": {
if (event.charOrCode == dojo.keys.ENTER)
searchBarSubmit();
},
- "style": {"width": "260px"},
+ "style": {"width": dojo.attr("search_box", "style").width},
"value": ((getTerm() != null) ? getTerm() : "")
}, "search_box"
);