2008-11-17 17:42:45 -05:00
|
|
|
<!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>
|
|
|
|
|
2008-12-15 20:03:00 -05:00
|
|
|
<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/clientside/ExtensibleResultWidget.js"/></script>
|
|
|
|
<script src="../../src/clientside/FacetWidget.js"/></script>
|
2008-11-17 17:42:45 -05:00
|
|
|
<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.ExtensibleResultWidget({
|
|
|
|
id:"result",
|
|
|
|
target:"#result",
|
|
|
|
rows:20,
|
|
|
|
renderResult : function(docs, pageSize, offset) {
|
|
|
|
var container = jQuery("<div/>");
|
|
|
|
$sj.each(docs, function(i, item) {
|
2008-12-15 20:03:00 -05:00
|
|
|
jQuery("<h3/>").html(item["id"]).appendTo(container);
|
2008-11-22 04:19:57 -05:00
|
|
|
if (item["cat"] != null) {
|
|
|
|
jQuery("<p/>").html(item["cat"].toString()).appendTo(container);
|
2008-11-17 17:42:45 -05:00
|
|
|
}
|
|
|
|
jQuery("<hr/>").appendTo(container);
|
|
|
|
});
|
|
|
|
container.appendTo(this.target);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
solrjsManager.addWidget(resultWidget);
|
2008-12-15 20:03:00 -05:00
|
|
|
solrjsManager.addWidget(new $sj.solrjs.FacetWidget({id:"cat", target:"#cat", fieldName:"cat"}));
|
2008-11-17 17:42:45 -05:00
|
|
|
solrjsManager.doRequestAll();
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
<style>img{ height: 100px; float: left; }</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="facets" style="float:left;width:300px;">
|
2008-12-15 20:03:00 -05:00
|
|
|
<h3 style="margin-top:0px">cat</h3>
|
|
|
|
<div id="cat"></div>
|
2008-11-17 17:42:45 -05:00
|
|
|
</div>
|
|
|
|
<div id="result" style="margin-left:300px;"></div>
|
|
|
|
</body>
|
|
|
|
</html>
|