Auto Completion (collection.cfg)
This option can be used to enable or disable Funnelback's auto completion feature. When set to 'enabled', auto completion of queries will be performed, while any other value (normally 'disabled') will disable auto completion.
Auto Completion Details
Using the Spelling Suggestions file allows out-of-the-box suggestions from the collection data without any configuration step required. This file is built by the build_spelling_index program which can be instructed to derive suggestions from various sources and to apply user-controllable criteria for inclusion. Suggestions are only included if they match the collection and are given a weight based on frequency of occurrence. Typical sources of suggestions are the corpus lexicon (single words), document annotations (such as anchortext, clicked queries, etc.), document titles and possibly other metadata fields.
Using the Best bets file allows to quickly build a suggestion list using the Best bets editor.
Please note that only Exact query match best bets will be considered. All auto completion entries from best bets have a weight of 100.0.
Custom CSV data
For more information about custom CSV data, please see the CSV Data section.
Scoped Auto Completion
Auto completion will be automatically scoped for each profile to prevent suggesting queries that would show no results in that profile. This works using the query processor options specified in the padre_opts.cfg file for the profile (if there is one). If the padre_opts.cfg file is not present, then auto completion suggestions are not scoped.
If a profile contains scope query processor options such as gscopes in its padre_opts.cfg file, auto completion suggestions are only generated for queries that return results once that scoping is applied.
Note that rich auto completion suggestions are never scoped - they will always be suggested to the user. Profile-based auto-completion.csv file is not supported at this point.
To turn on auto completion:
Adding auto completion to your site search box
Note: you need to ensure that:
- version numbers for jQuery and jQuery UI are set. You can compare with the versions that ship with Funnelback under SEARCH_HOME/web/public/js/jquery/
- the jquery.funnelback-completion.js code is included after any jquery libraries are loaded
- the Funnelback search.css (or relevant CSS rules to handle the auto completion styling) is included
jQuery("input.query").fbcompletion()call is matched to the html input element for the search box (ie. for the example below you need to set a class of 'query' on your search input box).
Customising (Styling) Auto Completions
When customising auto completion styling, we recommend the following:
- Using a browser extension that allows you to inspect and modify CSS in real-time (e.g. the Firebug extension for Firefox). Firebug is especially useful for viewing the HTML generated by Jquery, which is not otherwise visible when viewing the HTML source code.
- Any required additional HTML structures (e.g. adding a custom span around matching suggestions, within the HTML), can be added in the auto-completion.csv file.
- Any additional Jquery libraries referenced in the search form template may cause incompatibilities with the Funnelback auto completion functions. Firebug will provide a list of errors encountered when rendering a page and is a quick way to diagnose this issue. If multiple libraries are required, then moving the Funnelback Jquery script tags to the end of the head section may resolve the issue. A more complete solution would be to re-generate the Jquery libraries, with the required Autocomplete functions required by Funnelback.
An example customisation workflow is:
- Copy the auto completion CSS from funnelback.server/search/search.css to a custom CSS file. The relevant CSS is marked with an opening comment of
/* AUTO COMPLETION - Uses jquery-ui */.
- Refresh the search template to see how auto completion suggestions are displayed.
- Modify or create CSS rules as required, in your browser, using Firebug (or Chrome developer tools).
- Add the CSS rules to your custom CSS file.