mirror of
https://github.com/apache/lucene.git
synced 2025-02-28 21:39:25 +00:00
Morph client-side demo to use built-in Solr example fields
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@719831 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e4e015758d
commit
db76a97aa0
@ -48,11 +48,11 @@
|
||||
renderResult : function(docs, pageSize, offset) {
|
||||
var container = jQuery("<div/>");
|
||||
$sj.each(docs, function(i, item) {
|
||||
jQuery("<h3/>").html(item["title"]).appendTo(container);
|
||||
if (item["topics"] != null) {
|
||||
jQuery("<p/>").html(item["topics"].toString()).appendTo(container);
|
||||
jQuery("<h3/>").html(item["name"]).appendTo(container);
|
||||
if (item["cat"] != null) {
|
||||
jQuery("<p/>").html(item["cat"].toString()).appendTo(container);
|
||||
}
|
||||
jQuery("<p/>").html(item["text"]).appendTo(container);
|
||||
jQuery("<p/>").html(item["name"]).appendTo(container);
|
||||
jQuery("<hr/>").appendTo(container);
|
||||
});
|
||||
container.appendTo(this.target);
|
||||
@ -60,7 +60,7 @@
|
||||
});
|
||||
|
||||
solrjsManager.addWidget(resultWidget);
|
||||
solrjsManager.addWidget(new $sj.solrjs.FacetWidget({id:"topics", target:"#topics", fieldName:"topics"}));
|
||||
solrjsManager.addWidget(new $sj.solrjs.FacetWidget({id:"categories", target:"#categories", fieldName:"cat"}));
|
||||
solrjsManager.doRequestAll();
|
||||
});
|
||||
</script>
|
||||
@ -68,8 +68,8 @@
|
||||
</head>
|
||||
<body>
|
||||
<div id="facets" style="float:left;width:300px;">
|
||||
<h3 style="margin-top:0px">topics</h3>
|
||||
<div id="topics"></div>
|
||||
<h3 style="margin-top:0px">categories</h3>
|
||||
<div id="categories"></div>
|
||||
</div>
|
||||
<div id="result" style="margin-left:300px;"></div>
|
||||
</body>
|
||||
|
Loading…
x
Reference in New Issue
Block a user