Created
April 3, 2012 21:34
-
-
Save savis/2295648 to your computer and use it in GitHub Desktop.
XWiki Search front end
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{velocity}} | |
#set ($backend = $services.search.getID()) | |
Hello the Search backend being used is $backend | |
{{/velocity}} | |
{{html wiki="true"}} | |
<form method="post"> | |
Search Text :<input type="text" name="searchbox" id="searchbox" size=60/> | |
<br/> | |
Query fields :<input type="text" name="qfvaluebox" id="qfvaluebox" size=60/> | |
<br/> | |
<input type="submit" value="Search"/> | |
<form> | |
{{/html}} | |
{{velocity}} | |
#set($text = "$!request.getParameter('searchbox')") | |
#set($qfvalue = "$!request.getParameter('qfvaluebox')") | |
#if ( $text != "" ) | |
Searching [Field:String] $text | |
#set ( $results= $services.search.queryDocument($text,$qfvalue)) | |
Total Search results - [$results.size()] | |
#foreach ( $page in $results ) | |
$page | |
#end | |
#end | |
{{/velocity}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment