mirror of https://github.com/apache/lucene.git
Convert templates to using new QueryResponse response object
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@726780 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ebba8adb5c
commit
24cc3d9bce
|
@ -1,9 +1,6 @@
|
||||||
#if($params.getBool("debugQuery",false))
|
#if($params.getBool("debugQuery",false))
|
||||||
<pre>
|
#parse("debug.vm")
|
||||||
request = $request
|
|
||||||
|
|
||||||
response = $response.values
|
|
||||||
</pre>
|
|
||||||
#end
|
#end
|
||||||
|
|
||||||
|
<hr/>
|
||||||
Generated by <a href="http://wiki.apache.org/solr/VelocityResponseWriter">VelocityResponseWriter</a>
|
Generated by <a href="http://wiki.apache.org/solr/VelocityResponseWriter">VelocityResponseWriter</a>
|
|
@ -1,70 +1,67 @@
|
||||||
#set($doclist=$response.values.response)
|
|
||||||
#set($searcher=$request.searcher)
|
#set($searcher=$request.searcher)
|
||||||
#set($params=$request.params)
|
#set($params=$request.params)
|
||||||
#set($fields=$response.returnFields)
|
|
||||||
<html>
|
<html>
|
||||||
## TODO: Implement layouts
|
<head>
|
||||||
<head>
|
<title>#param('title')</title>
|
||||||
<title>#param('title')</title>
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
|
||||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
|
<script type="text/javascript" src="/solr/admin/jquery-1.2.3.min.js"></script>
|
||||||
<script type="text/javascript" src="/solr/admin/jquery-1.2.3.min.js"></script>
|
<link rel="stylesheet" type="text/css" href="/solr/admin/file?file=/velocity/main.css&contentType=text/css"/>
|
||||||
<link rel="stylesheet" type="text/css" href="/solr/admin/file?file=/velocity/main.css&contentType=text/css"/>
|
</head>
|
||||||
</head>
|
<body>
|
||||||
<body>
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
#parse("header.vm")
|
#parse("header.vm")
|
||||||
|
|
||||||
#set($filter_queries = $params.getParams('fq'))
|
#set($filter_queries = $params.getParams('fq'))
|
||||||
#foreach($fq in $filter_queries)
|
#foreach($fq in $filter_queries)
|
||||||
> <a href="#url_for_filters($filter_queries.subList(0,$velocityCount))">$fq</a>
|
> <a href="#url_for_filters($filter_queries.subList(0,$velocityCount))">$fq</a>
|
||||||
#end
|
#end
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="query-box">
|
<div class="query-box">
|
||||||
<form id="query-form" action="/solr/itas" method="GET">
|
<form id="query-form" action="/solr/itas" method="GET">
|
||||||
Query: <input type="text" name="q" value="$!params.get('q')"/>
|
Query: <input type="text" name="q" value="$!params.get('q')"/>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="facet-fields">
|
|
||||||
#foreach($field in $response.values.facet_counts.facet_fields)
|
<div class="facet-fields">
|
||||||
<span class="facet-field">$field.key</span>
|
#foreach($field in $response.facetFields)
|
||||||
<ul>
|
<span class="facet-field">$field.name</span>
|
||||||
#foreach($facet in $field.value)
|
<ul>
|
||||||
#set($facetURL = "#url_for_nested_facet($field.key, $facet.key)")
|
#foreach($facet in $field.values)
|
||||||
#if ($facetURL != '')
|
#set($facetURL = "#url_for_nested_facet($field.name, $facet.name)")
|
||||||
<li><a href="$facetURL">$facet.key</a> ($facet.value)</li>
|
#if ($facetURL != '')
|
||||||
#end
|
<li><a href="$facetURL">$facet.name</a> ($facet.count)</li>
|
||||||
#end
|
#end
|
||||||
</ul>
|
#end
|
||||||
#end
|
</ul>
|
||||||
</div>
|
#end
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="pagination">
|
<div class="pagination">
|
||||||
<span><span class="results-found">$page.results_found</span> results found in ${response.responseHeader.QTime} ms</span>
|
<span><span class="results-found">$page.results_found</span> results found in ${response.responseHeader.QTime} ms</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="results">
|
<div class="results">
|
||||||
#foreach($id in $doclist.iterator())
|
#foreach($doc in $response.results)
|
||||||
#set($doc = $searcher.doc($id,$response.returnFields))
|
#parse("hit.vm")
|
||||||
#parse("hit.vm")
|
#end
|
||||||
#end
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="pagination">
|
<div class="pagination">
|
||||||
#link_to_previous_page("previous")
|
#link_to_previous_page("previous")
|
||||||
<span class="results-found">$page.results_found</span> results found.
|
<span class="results-found">$page.results_found</span> results found.
|
||||||
Page <span class="page-num">$page.current_page_number</span> of <span
|
Page <span class="page-num">$page.current_page_number</span> of <span
|
||||||
class="page-count">$page.page_count</span>
|
class="page-count">$page.page_count</span>
|
||||||
#link_to_next_page("next")
|
#link_to_next_page("next")
|
||||||
|
|
||||||
<br/>
|
<br/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
#parse("footer.vm")
|
#parse("footer.vm")
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -0,0 +1,9 @@
|
||||||
|
<h1>REQUEST</h1>
|
||||||
|
<div>
|
||||||
|
$esc.html($request)
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h1>RESPONSE</h1>
|
||||||
|
<div>
|
||||||
|
$esc.html($response)
|
||||||
|
</div>
|
|
@ -1,18 +1,16 @@
|
||||||
<div class="result-document">
|
<div class="result-document">
|
||||||
#foreach($field in $doc.fields)
|
#foreach($fieldname in $doc.fieldNames)
|
||||||
#if($response.returnFields.contains("*") || $response.returnFields.contains($field.name()))
|
|
||||||
<p>
|
<p>
|
||||||
<span class="field-name">$field.name() :</span>
|
<span class="field-name">$fieldname :</span>
|
||||||
<span>
|
<span>
|
||||||
##TODO: Need to provide helpers for field values, including HTML escaping and highlighting
|
#foreach($value in $doc.getFieldValues($fieldname))
|
||||||
#foreach($value in $doc.getFieldables($field.name()))
|
$value
|
||||||
$request.schema.getFieldType($field.name()).toExternal($value)
|
|
||||||
#end
|
#end
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
#end
|
|
||||||
#end
|
#end
|
||||||
#if($params.getBool("debugQuery",false))
|
#if($params.getBool("debugQuery",false))
|
||||||
<a href="#" onclick='jQuery(this).siblings("pre").toggle(); return false;'>toggle explain</a> <pre style="display:none">$response.values.debug.explain.get($doc.get('id'))</pre>
|
<a href="#" onclick='jQuery(this).siblings("pre").toggle(); return false;'>toggle explain</a>
|
||||||
|
<pre style="display:none">$response.getExplainMap().get($doc.getFirstValue('id'))</pre>
|
||||||
#end
|
#end
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue