Getting started guide – Prefixbox Documentation

Getting started

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…

Installation

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.

Data

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.

A simple suggestion list

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.

create-sgl

A more advanced suggestion list

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.

Suggestion list file format

Field
Description
display text
The text that is displayed for the suggestion in the dropdown list and in the search box.
popularity score
(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.
image URL
(optional) Absolute URL to a thumbnail image file that will be served with the suggestion.
tag
(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.

 

Uploading Data

All suggestions lists are made available to the Prefixbox services by one of following ways:

  1. Through manual upload: the easiest way to setup your first suggestion list is by uploading it through the portal. Once uploaded the data will be available in 2 minutes for serving.
  2. Scheduled server-side download: if your data changes regularly you can automate the refresh by specifying and HTTP location for your suggestion list file and set the download frequency on the portal.
  3. Download from Google Analytics: the quickest way to get a suggestion list is by downloading your site search keywords or organic search keywords from Google Analytics. The portal provides a wizard for you to quickly do this.
  4. Automated data refresh: when the analytics collection is configured for the search box it is possible to update the suggestion list on a daily basis by updating the popularity score and adding new suggestions automatically.

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.

Create search box

 

Search settings

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.Add search setting

In 15 seconds the changes will be Live and you will be able to try it on the Test search box tab.

Test searchbox