]> git.evergreen-ils.org Git - Evergreen.git/blob - docs/TechRef/AutoSuggest/README
LP2061136 - Stamping 1405 DB upgrade script
[Evergreen.git] / docs / TechRef / AutoSuggest / README
1 AutoSuggest
2
3 Get an autocompleting dialog underneath basic search boxes.
4
5 If activated, the dialog appears in the Bootstrap OPAC.
6
7 Mike Rylander and Bill Erickson largely designed and spec'ed out this
8 feature, especially at the database level.  Lebbeous Fogle-Weekley and
9 Mike Rylander did the programming.
10
11 How it works, for site administrators
12 -------------------------------------
13
14 Once the code is installed, including database stored procedures,
15 (re)ingesting your bibliographic records will populate two new tables
16 needed by AutoSuggest: metabib.browse_entry and metabib.browse_entry_def_map.
17
18 Yes, for now this means that the size of your database in per-record terms
19 will be greater.  The browse_entry data we generate is extremely similar to
20 facet data, so it's possible that in the future we can blend them into the
21 same thing at the database level, and save some space.
22
23 To control what gets indexed in the metabib.browse_* tables, set the
24 boolean 'browse_field' column for each row in config.metabib_field as desired
25 Numbers 15 (keyword|keyword) and 16 (subject|complete) should generally be set
26 to false.
27
28 The config.metabib_class  table has a new 'buoyant'
29 column.  Setting this to true means that when a user is typing in the OPAC
30 search box with a search class selector set to, say, 'Subject', and the cmc row
31 for 'Subject' has 'buoyant' set to true, the top suggestions will definitely
32 come from the Subject fields of MARC records (if any).  'restrict' is like
33 'buoyant', only stronger.  In that case suggestions /only/ come from the
34 selected class.
35
36 This is the idea behind the 'restrict' column (in both the
37 config.metabib_class table and the config.metabib_field table):
38 For any given class or field, if restrict is true AND the user at the OPAC
39 has selected that same class or field from the search class dropdown, then
40 autosuggestions will only come from that class or field in the record.
41  
42 You never want this column to be true for keyword, because we don't index
43 keywords for browse/autosuggest purposes (we would get giant blobs of
44 information as autosuggestions, and you don't want that (really)).
45  
46 You don't really want it to be true for most classes and fields.
47 If the user sets the dropdown to "subject" and start typing "harry potter",
48 the user really wants matches from the "title" class too (although other
49 things being equal, matches from the "subject" class will rise to the top).
50  
51 If you have a speciality index, you *may* want to set restrict to true
52 for that particular field.  For a song title index, for example.  To take
53 advantage of this, you would also have to customize your OPAC to have an
54 entry in the search class dropdown for 'title|songtitle' (or whatever's
55 appropriate for your specialty index).  This is easy to do and should be
56 covered somewhere in documentation for the TPAC.
57
58 The order of suggestions otherwise has mostly to do with how well what users
59 have typed matches what's in your bib records, and the value of the weight
60 column of the relevant config.metabib_field row.  Examine the code if you're
61 curious to know more or want to make adjustments.
62
63 The master on/off switch for AutoSuggest is a new row in in config.global_flag
64 named 'opac.use_autosuggest'.  Set its 'enabled' column to false to turn
65 off AutoSuggest.  If you don't want your suggestions to be limited to whatever's
66 OPAC visible at the search org, set the 'value' column to anything that
67 does not contain the string 'opac_visible'.  This could be a good idea
68 if AutoSuggest seems slow on a large site.
69
70 Managing the little stuff
71 -------------------------
72 CSS classes that affect the look of suggestions are in this file for the TPAC:
73     Open-ILS/web/css/skin/default/opac/style.css
74
75 At bottom, autosuggest is shaped by PostgreSQL's Full Text Search features.
76 Some of the arguments that are passed to TS_RANK_CD() and TS_HEADLINE() are
77 exposed via options to the openils.widget.AutoSuggest and
78 openils.AutoSuggestStore modules, which have comments.  You can customize your
79 OPAC files to invoke these with your desired options without touching much
80 actual code.