General Actions:
Log-in
Wiki:
L3D's Wiki
▼
:
Document Index
»
Space:
XWiki
▼
:
Document Index
»
Page:
LuceneSearchAdmin
Search
Page Actions:
Export
▼
:
Export as PDF
Export as RTF
Export as HTML
More actions
▼
:
Print preview
View Source
Welcome to your wiki
»
Search administration
»
Lucene search administration
Wiki source code of
Lucene search administration
Last modified by
Administrator
on 2011/03/02 17:34
Content
·
Comments
(0)
·
Attachments
(0)
·
History
·
Information
Show line numbers
{{velocity output="false"}} #set ($lucene = $xwiki.lucene) {{/velocity}} {{velocity}} #if ($hasAdmin) #if ($request.action == 'indexfarm') #if ($xcontext.isMainWiki()) #set ($clearIndex = true) #set ($onlyNew = false) #set ($startindex = true) #else## !$xcontext.isMainWiki() {{error}}$msg.get('needadminrights').{{/error}} #end #elseif ($request.action == 'indexcurrentwiki') #set ($wikis = [$xcontext.database]) #set ($wikisString = "${xcontext.database}") #set ($clearIndex = true) #set ($onlyNew = false) #set ($startindex = true) #elseif ($request.action == 'indexcustom') #if ($xcontext.isMainWiki()) #if ("$!{request.wikis.trim()}" != '') #set ($wikisArray = $request.wikis.split(',')) #set ($wikis = $wikisArray.subList(0, $wikisArray.size())) #set ($wikisString = $request.wikis) #end #else## !$xcontext.isMainWiki() #set ($wikis = [$xcontext.database]) #set ($wikisString = "${xcontext.database}") #end #set ($hqlFilter = $request.hqlFilter) #set ($clearIndex = $request.clearIndex == 'on') #set ($onlyNew = $request.onlyNew == 'on') #set ($startindex = true) #end ## #if ($startindex) #set ($errorcode = $lucene.startIndex($wikis, $hqlFilter, $clearIndex, $onlyNew)) #if ($errorcode > 0) {{info}}$msg.get('search.admin.lucene.indexing.message.started'){{/info}} #elseif ($errorcode == -1) {{error}}$msg.get('needadminrights').{{/error}} #elseif ($errorcode == -2) {{warning}}$msg.get('search.admin.lucene.indexing.message.alreadystarted'){{/warning}} #end #end #else## !hasAdmin {{error}}$msg.get('needadminrights').{{/error}} #end## hasAdmin {{/velocity}} (% id="Hsearch.admin.lucene.status.title" %) == {{velocity}}$msg.get('search.admin.lucene.status.title'){{/velocity}} == {{velocity}} |=$msg.get('search.admin.lucene.status.infotitle')|=$msg.get('search.admin.lucene.status.valuetitle') |$msg.get('search.admin.lucene.status.indexed')|$lucene.luceneDocCount |$msg.get('search.admin.lucene.status.indexing')|$lucene.queueSize {{/velocity}} (% id="Hsearch.admin.lucene.indexing.title" %) == {{velocity}}$msg.get('search.admin.lucene.indexing.title'){{/velocity}} == {{velocity}}$msg.get('search.admin.lucene.indexing.description'){{/velocity}} {{velocity}} #if ($hasAdmin) {{html}} <form action="$xwiki.requestURL" enctype="multipart/form-data" method="post"> <fieldset> <input type="hidden" name="form_token" value="$!{services.csrf.getToken()}" /> ## Does not really make sense to reindex the whole farm from a subwiki #if ($xcontext.isMainWiki()) <p> <label for="indexfarm"><input id="indexfarm" name="action" type="radio" value="indexfarm" #if (!$request.action || $request.action == 'indexfarm')checked="checked" #end/> $msg.get('search.admin.lucene.indexing.action.indexfarm')</label> </p> #end <p> <label for="indexcurrentwiki"><input id="indexcurrentwiki" name="action" type="radio" value="indexcurrentwiki" #if((!$xcontext.isMainWiki() && !$request.action) || $request.action == 'indexcurrentwiki'))checked="checked" #end/> $msg.get('search.admin.lucene.indexing.action.indexcurrentwiki')</label> </p> ## Needs programming right because it takes a custom HQL query which could be dangerous <p> <label for="indexcustom"><input id="indexcustom" name="action" type="radio" value="indexcustom" #if ($request.action == 'indexcustom')checked="checked" #end/> $msg.get('search.admin.lucene.indexing.action.indexcustom')</label> </p> <p> #if ($xcontext.isMainWiki()) <label for="indexcustom_wikis">$msg.get('search.admin.lucene.indexing.action.indexcustom.wikis')</label> <input id="indexcustom_wikis" name="wikis" type="text" title="$escapetool.xml($msg.get('search.admin.lucene.indexing.action.indexcustom.wikis.title'))" value="$!wikisString" /> #else <input id="indexcustom_wikis" name="wikis" value="${xcontext.database}" type="hidden" value="$!wikisString" /> #end </p> #if ($hasProgramming && $xcontext.isMainWiki()) <p> <label for="indexcustom_hqlFilter">$msg.get('search.admin.lucene.indexing.action.indexcustom.hqlfilter')</label> <input id="indexcustom_hqlFilter" name="hqlFilter" type="text" title="$escapetool.xml($msg.get('search.admin.lucene.indexing.action.indexcustom.hqlfilter.title'))" #if($request.hqlFilter)value="${escapetool.xml($request.hqlFilter)}"#end /> </p> #end <p> <label for="indexcustom_clearIndex"><input id="indexcustom_clearIndex" name="clearIndex" type="checkbox" title="$escapetool.xml($msg.get('search.admin.lucene.indexing.action.indexcustom.clearindex.title'))" #if($clearIndex)checked="checked" #end/> $msg.get('search.admin.lucene.indexing.action.indexcustom.clearindex')</label> </p> <p> <label for="indexcustom_onlyNew"><input id="indexcustom_onlyNew" name="onlyNew" type="checkbox" title="$escapetool.xml($msg.get('search.admin.lucene.indexing.action.indexcustom.onlynew.title'))" #if($onlyNew)checked="checked" #end/> $msg.get('search.admin.lucene.indexing.action.indexcustom.onlynew')</label> </p> <span class="buttonwrapper"><input type="submit" value="$msg.get('search.admin.lucene.indexing.button')" class="button"/></span> </fieldset> </form> {{/html}} #else## !$hasAdmin {{error}}$msg.get('needadminrights').{{/error}} #end {{/velocity}}
Quick Links
L3D Calendar
Wiki Dashboard
Document Index
Blog
Sandbox