Index

septimasearch.debug.js

Septima Search
Search local and remote sources.

Simple demo (including source) here

See it in action here:

Version:
  • {version}
Author:
  • Septima P/S www.septima.dk

Examples

Include these scripts:

<!-- Include jquery -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"/>

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

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

Create a controller:

var controller = new Septima.Search.Controller(
  [],
  blankBehavior: "search",
  onError : doSomethingWithError
});

Create searchers and add to controller:

var dawaSearcher = new Septima.Search.DawaSearcher({
  kommunekode: 101,
  onSelect : function(result) {
    console.log('<b>Adresse valgt:</b> '+ result.title  + ". Geometry: " + JSON.stringify(result.geometry) + '<br/>');
 }});
controller.addSearcher({title: "Adresser", searcher: dawaSearcher});
  
var s4IndexSearcher = new Septima.Search.S4IndexSearcher({
  host: "http://v3100.sps-demo.septima.dk/",
  datasources: "*",
  blankBehavior: "search",
  allowDetails: true,
  onSelect : function(result) {
    console.log('<b>S4 feature valgt:</b> '+ result.title  + ". Geometry: " + JSON.stringify(result.geometry) + '<br/>');
 }});
 controller.addSearcher({title: "S4Index", searcher: s4IndexSearcher});

Set up the search box:

var view = new Septima.Search.DefaultView({input : 'inputcontainer', controller: controller});