It is not necessary, although of course possible, to setup Alkaline a second time in a different location,
or to run a second instance of Alkaline on a different port. Alkaline has extensive support for groups
and multiple aliases; you don't even need to restart Alkaline to add a new fully configured site,
it will pick up the configuration changes when the next indexing roundtrip is completed. To add a
second site that is indexed and searched separately:
Setup a first site.
For example, create /alkaline/foo/asearch.cnf
which contains
the appropriate directives to index the Foo site.
Create and place the search.html template for the first site in the same foo directory, for example
at /alkaline/foo/search.html
Make sure that you can index and search the Foo site by simply running
./asearch foo reindex.
Create a second asearch.cnf in a different directory, for example
/alkaline/bar/asearch.cnf
which contains the appropriate directives to
index the Bar site. Follow the same procedure as for the Foo site.
Create and place the search.html template for the Bar site.
Follow the same procedure as for the first site, for example /alkaline/bar/search.html
.
Modify the second search.html template to post the search
for Bar to http://yourserver:port/bar/search.html
.
Restart Alkaline with both the foo
and the bar
arguments, for
example ./asearch 9999 foo bar &
.
To search either of the sites with the same template, a checkbox or a dropdown menu has to be added.
A piece of simple JavaScript code will do the job of replacing the form action
parameter with the appropriate one. A good example of the code can be found at
www.warez.com
search engine:
<script LANGUAGE="JavaScript">
<!--
function setAction() {
document.formName.action =
document.formName.selectName.options[
document.formName.selectName.selectedIndex
].value;
return true;
}
document.writeln('<form name="formName"
action="????????"
method="POST"
onSubmit="return setAction()">
Search for
<select name="selectName">
<option
selected
value="http://www.server.com:9999/foo/search.html">
Foo
<option
value="http://www.server.com:9999/bar/search.html">
Bar
</select>
<input type="text"
name="search"
value="">
<input
type="submit"
value="Search">
//--></script>
|