Skip to content

Instantly share code, notes, and snippets.

@savis
Created April 3, 2012 21:34
Show Gist options
  • Save savis/2295648 to your computer and use it in GitHub Desktop.
Save savis/2295648 to your computer and use it in GitHub Desktop.
XWiki Search front end
{{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