Prefixbox is a high quality autocomplete technology which makes finding information on your website simple. It’s lightweight, easy to set up, doesn’t depend on any other libraries (like jQuery) and is highly customizable.
Enough chatter, let's try it out! Let’s search for some popular movies, shall we...
The only code you need to add to your site for the functionality above is:
<script async src="//script.prefixbox.com/plugin.js?btr=tracker_id"></script>
In the Prefixbox portal you also need to specify which HTML input textbox needs the suggestions. You can do that by specifying the id attribute value on the portal.
<input id="search-id" type="text" />
Now that is simple!
Prefixbox still requires you to supply your own data and upload it to the Prefixbox servers before it can provide you with suggestions. But you're in luck, we will cover this in the data section below.
Prefixbox is all about the data. Each box you see on a webpage can be powered by one or more suggestion lists (that is the term we use for the datasets that underpin the search).
The Prefixbox service comes with a fully equipped data management console that assists you with uploading, managing and monitoring the data served by your search boxes.
All data starts out as simple delimited text files (CSV or TSV) that you upload to the Prefixbox servers. Then our algorithms will do their magic to prepare your source data for use in one or more Prefixbox search box instances.
First let's create some data.
The only thing you need to create your first suggestion list file is a simple text editor, like notepad for example.
The most basic structure of the suggestion list source file has two columns, the suggestion and a popularity score. Below is an example for a simple comma separated source file:
a new hope, 100 empire strikes back, 100 return of the jedi, 100 revenge of the sith, 10
Always make sure to assign a non-zero popularity score to your suggestions.
In order to use these suggestions you should create a suggestion list on the portal. Select the Suggestion list type as Text Suggestions which is the most simple type. Make sure you specify the language correctly. It may be important, especially if you work with languages which contain diacritic characters, such as Hungarian, German or Slovak.
You can create suggestion lists with more settings as described in the following table. During the manual upload steps the Prefixbox portal gives you specific details about the data format based on your settings.
|The text that is displayed for the suggestion in the dropdown list and in the search box.|
|(optional) A non-zero popularity score assigned to this suggestion. This value should be an integer (no fractions). The ranking algorithm logic is that suggestions with higher scores will be preferred over those with lower scores.|
click through URL
|(optional) The URL that the user should be re-directed to when the suggestion is selected.|
|(optional) Absolute URL to a thumbnail image file that will be served with the suggestion.|
|(optional) A string value that identifies a topic that the suggestion belongs to. This can be used to distinguish between suggestions from multiple suggestion-lists in a single box or as extra information to the user.|
All suggestions lists are made available to the Prefixbox services by one of following ways:
Now that you have a suggestion list it’s time to add it to a search box. Let’s create a Site search box. Here the Default search URL setting specifies the URL format of your search engine where the selected suggestion will be executed.
In order to specify the association between the search box and the suggestion lists you need to specify search settings. You can do this on the Search settings tab. You can assign multiple suggestions lists here and specify the ranking between them.
In 15 seconds the changes will be Live and you will be able to try it on the Test search box tab.