Index

js/septima.search.js

Septima Search
Search local and remote sources.

Simple demo (including source) here

See it in action here:
http://labs.septima.dk/search/cvr.html, and
http://sps-demo.septima.dk/cbkort?
Version:
  • 2.9.6
Author:
  • Septima P/S www.septima.dk
Source:
  • septima.search.js, line 1

Examples

Include these scripts:

<!-- Include jquery -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />

<!-- Include common javascript libraries -->
<script type="text/javascript" src="http://common.cdn.septima.dk/latest/js/septima.js"></script>
<script type="text/javascript" src="http://common.cdn.septima.dk/latest/js/json2.js"></script>

<!-- Include septimaSearch -->
<script type="text/javascript" src="http://search.cdn.septima.dk/2.9.6/septimasearch.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://search.cdn.septima.dk/2.9.6/css/defaultView.css">

Create an array of searchers:

var searchers = [];
var adressSearchOptions = {
    apiKey : 'FCF3FC50-C9F6-4D89-9D7E-6E3706C1A0BD',
    area : 'muncode0101',
    onSelect : adressHit};

searchers.push({title : 'Adresse', searcher : new Septima.Search.AddressSearcher(adressSearchOptions)});

Set up the search box:

var view = new Septima.Search.DefaultView({input : 'inputcontainer', placeholder : 'Søg'});

Initialize and start a controller:

var controller = new Septima.Search.Controller(
searchers,
view,
{onError : doSomethingWithError);

Do something when the user selects a hit:

function adressHit(result){
	alert("adress selected: " + result.data.presentationString);
}