SOLR-2178: more movement towards tutorial status: added tool tip annotations, called out the facet types more distinctly, added a link to the Solr Admin

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1026058 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Grant Ingersoll 2010-10-21 16:30:53 +00:00
parent c723559a59
commit 408e18b10c
12 changed files with 57 additions and 31 deletions

View File

@ -1,3 +1,4 @@
#macro(param $key)$request.params.get($key)#end
#macro(url_for_solr)/solr#if($request.core.name != "")/$request.core.name#end#end
@ -9,9 +10,13 @@
#macro(debug)#if($request.params.get('debugQuery'))&debugQuery=true#end#end
#macro(boostPrice)#if($request.params.get('bf') == 'price')CHECKED#end#end
#macro(boostPrice)#if($request.params.get('bf') == 'price')&bf=price#end#end
#macro(lens)?#q#if($request.params.getParams('fq') and $list.size($request.params.getParams('fq')) > 0)&#fqs($request.params.getParams('fq'))#end#debug#if($request.params.get('bf') == 'price')&bf=price#end#end
#macro(annotate)#if($request.params.get('annotateBrowse'))&annotateBrowse=true#end#end
#macro(annTitle $msg)#if($annotate == true)title="$msg"#end#end
#macro(lens)?#q#if($request.params.getParams('fq') and $list.size($request.params.getParams('fq')) > 0)&#fqs($request.params.getParams('fq'))#end#debug#if($request.params.get('bf') == 'price')&bf=price#end#annotate#end
#macro(url_for_lens)#{url_for_home}#lens#end

View File

@ -1,16 +1,17 @@
#set($searcher=$request.searcher)
#set($params=$request.params)
#set($clusters = $response.response.clusters)
#set($annotate = $request.params.get("annotateBrowse"))
<div class="query-box">
<form id="query-form" action="#{url_for_home}" method="GET">
<a href="#url_for_home#if($request.params.get('debugQuery'))?debugQuery=true#end"><img src="#{url_for_solr}/admin/solr_small.png" id="logo"/></a>
<div class="inputs"><span>Find: <input type="text" id="q" name="q" value="$!esc.html($params.get('q'))"/> <input type="submit"/> <input type="reset"/></span>
<div class="query-boost"><input type="checkbox" name="bf" value="price" #boostPrice>Boost by Price</input> </div></div>
<div class="query-boost"><input type="checkbox" name="bf" #annTitle("Add the boost function &bf=price to the query") value="price" #if($request.params.get('bf') == 'price')checked="true"#end>Boost by Price</input> </div></div>
#if($request.params.get('debugQuery'))
<input type="hidden" name="debugQuery" value="true"/>
#end
#if($annotate == true)
<input type="hidden" name="annotateBrowse" value="true"/>
#end
#foreach($fq in $request.params.getParams('fq'))
<input type="hidden" name="fq" value="$esc.html($fq)"/>
#end

View File

@ -1,4 +1,5 @@
##TODO: Generically deal with all dates
<h2 #annTitle("Facets generated by adding &facet.date= to the request")>Date Facets</h2>
#set($field = $response.response.facet_counts.facet_dates.manufacturedate_dt)
#set($gap = $response.response.facet_counts.facet_dates.manufacturedate_dt.gap)
#display_facet_date($field, "Manufacture Date", "manufacturedate_dt", $gap)

View File

@ -0,0 +1,12 @@
#if($response.facetFields)
<h2 #annTitle("Facets generated by adding &facet.field= to the request")>Field Facets</h2>
#foreach($field in $response.facetFields)
<span class="facet-field">$field.name</span>
<ul>
#foreach($facet in $field.values)
<li><a href="#url_for_facet_filter($field.name, $facet.name)">$facet.name</a> ($facet.count)</li>
#end
</ul>
#end
#end

View File

@ -1,2 +1,3 @@
<h2 #annTitle("Facets generated by adding &facet.pivot= to the request")>Pivot Facets</h2>
#set($pivot = $response.response.facet_counts.facet_pivot)
#display_facet_pivot($pivot, "Pivots")
#display_facet_pivot($pivot, "")

View File

@ -1,2 +1,3 @@
#set($field = $response.response.facet_counts.facet_queries)
#display_facet_query($field, "Facet Queries", "")
<h2 #annTitle("Facets generated by adding &facet.query= to the request")>Query Facets</h2>
#display_facet_query($field, "", "")

View File

@ -1,3 +1,4 @@
<h2 #annTitle("Facets generated by adding &facet.range= to the request")>Range Facets</h2>
#set($field = $response.response.facet_counts.facet_ranges.price.counts)
#set($start = $response.response.facet_counts.facet_ranges.price.start)
#set($end = $response.response.facet_counts.facet_ranges.price.end)

View File

@ -1,15 +1,4 @@
#if($response.facetFields)
<h2>Facets</h2>
#foreach($field in $response.facetFields)
<span class="facet-field">$field.name</span>
<ul>
#foreach($facet in $field.values)
<li><a href="#url_for_facet_filter($field.name, $facet.name)">$facet.name</a> ($facet.count)</li>
#end
</ul>
#end
#end
#parse('facet_fields.vm')
#parse('facet_queries.vm')
#parse('facet_ranges.vm')
#parse('facet_dates.vm')

View File

@ -6,5 +6,11 @@ Generated by <a href="http://wiki.apache.org/solr/VelocityResponseWriter">Veloci
#else
<a href="#url_for_lens&debugQuery=true">enable debug</a>
#end
#if($annotate)
<a href="#url_for_home?#q#if($list.size($request.params.getParams('fq')) > 0)&#fqs($request.params.getParams('fq'))#end#boostPrice">disable annotation</a>
#else
<a href="#url_for_lens&annotateBrowse=true">enable annotation</a>
#end
<a href="#url_for_lens&wt=xml#if($request.params.get('debugQuery'))&debugQuery=true#end">XML</a>

View File

@ -1 +1,3 @@
## empty header, customize as desired
<div id="head">
<span ><a href="#url_for_home#if($request.params.get('debugQuery'))?debugQuery=true#end"><img src="#{url_for_solr}/admin/solr_small.png" id="logo"/></a></span>
</div>

View File

@ -29,6 +29,7 @@
</head>
<body>
<div id="admin"><a href="#url_for_solr/admin">Solr Admin</a></div>
<div id="header">
#parse("header.vm")
</div>

View File

@ -1,3 +1,11 @@
#admin{
text-align: right;
vertical-align: top;
}
#head{
width: 100%;
}
.array-field {
border: 2px solid #474747;
background: #FFE9D8;
@ -73,15 +81,14 @@ a {
background: white;
}
#logo {
margin: 10px;
border-style: none;
}
.constraints {
margin-top: 10px;
}
#query-form{
width: 80%;
}
.query-box, .constraints {
padding: 5px;
margin: 5px;
@ -100,8 +107,7 @@ a {
}
.query-box {
top: -35px;
position: relative;
}
.query-boost {
@ -116,12 +122,12 @@ a {
left: 180px;
top: -20px;
position: relative;
}
#logo {
top: 35px;
position: relative;
margin-right: 50px;
margin: 10px;
border-style: none;
}
.pagination {