Install Oktavia to Website
This search engine provides a basic web interface and a style sheet based on jQuery. This document describes how to install this interface on your websites.
There are many styles of HTML all over the world. This search engine is a very early version and I have tried to install int in few cases. If your HTML files are not matched with its assumptions, you should modify the interface script.
Basic Folder Structure
This is a basic structure:
[document root] + index.html + search/ | + oktavia-search.js or oktavia-*-search.js | + oktavia-jquery-ui.js | + jquery.js | + searchindex.js | + oktavia-jquery-highlight.js (optional) + searchstyle.css + [other contents]
You can use both a domain root and a directory as a document root:
- Domain Root: http://example.com/
- Sub domain Root: http://doc.example.com/
- Directory: http://example.com/doc/
You should add five files to your folder:
oktavia-search.js or oktavia-*-search.js
One of these is a core component of this search engine. They are in lib folder of the package. oktavia-search.js is a standard version. Others includes a stemming library in addition to the standard version. For example oktavia-german-search.js has a German stemmer.
oktavia-jquery-ui.js needs jQuery library to manipulate DOM. It is tested with 1.9.1.
This is the default style of a search form and search result. You should modify it to match your website.
This is the index file of the document. It is as same as the index described in Tutorial.
This is an option module. This module provides a word highlight feature at landing pages. If your website is based on Sphinx or Tinkerer, you don’t have to add this. Oktavia web interface adds GET parameters compatible with Sphinx.
- From 0.5, Search words highlight feature is added.
- From 0.5, .js output become default. You don’t have to add -t js explicitly.
Add the following lines in your HTML files that you want to show a search form:
<link rel="stylesheet" href="searchstyle.css" type="text/css" /> <script src="search/jquery-1.9.1.min.js"></script> <script src="search/oktavia-jquery-ui.js"></script> <script src="search/oktavia-english-search.js"></script>
If you don’t use Sphinx or Tinkerer and you want to add search word highlighting, add the following line:
This code sample uses jQuery 1.9.1 minified version. It can also work with the older version of jQuery. jQuery 1.4 was confirmed to work with Oktavia.