lucene/contrib/javascript/example/testServerside.html
Ryan McKinley fb340c0406 SOLR-868: Adding solrjs as a contrib package: contrib/javascript.
(Matthias Epheser via ryan)

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@718422 13f79535-47bb-0310-9956-ffa450edef68
2008-11-17 22:42:45 +00:00

70 lines
2.4 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
<head>
<style type="text/css">
body { font-family: Arial, sans; font-size: 0.8em}
</style>
<script src="../lib/jquery/jquery-1.2.6.js"></script>
<script src="../src/core/Core.js"></script>
<script src="../src/core/QueryItem.js"></script>
<script src="../src/core/Manager.js"></script>
<script src="../src/core/AbstractWidget.js"></script>
<script src="../src/core/AbstractServerSideWidget.js"></script>
<script src="../src/core/AbstractClientSideWidget.js"></script>
<script src="../src/serverside/SimpleServerSideWidget.js"/></script>
<script src="../src/serverside/FacetServerSideWidget.js"/></script>
<script>
var $sj = jQuery.noConflict();
</script>
<script>
var solrjsManager;
$sj(document).ready(function(){
solrjsManager = new $sj.solrjs.Manager({solrUrl:"http://localhost:8983/solr/select"});
// a custom result widget
var resultWidget = new $sj.solrjs.SimpleServerSideWidget({
id:"result",
target:"#result",
rows:5,
templateName:"result"
});
solrjsManager.addWidget(resultWidget);
solrjsManager.addWidget(new $sj.solrjs.FacetServerSideWidget({id:"topics", target:"#topics", fieldName:"topics"}));
solrjsManager.doRequestAll();
});
</script>
</head>
<body>
<body>
<div id="facets" style="float:left;width:300px;">
<h3 style="margin-top:0px">topics</h3>
<div id="topics"></div>
</div>
<div id="result" style="margin-left:300px;"></div>
</body>
</body>
</html>