Costumized Lucene Search Page
With RC1 lucene seems to work again, so i have costumized the existing search form from jkraemer (http://www.jkraemer.net/static/maven/xwiki/plugins/lucene-plugin/install.htm...) But keep attention: it's just a quick&dirty example to display the results in a table ;-) As im not very familiar with velocity, the code is quite ugly! (for example i didn't find a while loop to output the number of stars for score-quality, so i did it with if, if, if..) it still has some bugs: * if you search for a regular expression (e.g. win*), then the query for the next page will be win</strong> * non wiki-documents and non-attachments will be hidden from the results, so it could happen that you see an empty page with a link to the next results (that's because searchresults.hitcount returns all results, also the hidden ones..) * many more.. * icons are hard-coded.. (/skins/lgs/*.png) You can get the icons for free from famfamfam: http://www.famfamfam.com/lab/icons/silk/ --------------------------- Searchform.vm: 1 Search #set($query = $request.getParameter("text")) #if(!$query) #set($query = "") #end #warning("This is the new lucene search engine.\\ If you experience any problems, try to use the default xwiki [Search>WebSearch?text=$query]..") #set($itemsPerPage = "30") #set($doRebuild = $request.getParameter("rebuild")) #if($doRebuild=="yes") #set($lucene = $xwiki.getPlugin("lucene")) #if($lucene) #set($documentCount = $lucene.rebuildIndex($xwiki,$context)) #if(${documentCount}>=0) Started index rebuild with $documentCount documents. Will take some time depending on the number of pages/attachments. #else Index rebuild failed. #end #end #else #if($xwiki.hasAdminRights()) [rebuild Index>${doc.web}.${doc.name}?rebuild=yes] #end #end {pre} <form action="$doc.name" method="post"> <input type="text" name="text" value="$query" /> <input type="submit" value="Search"/> </form> {/pre} #if($query != "") #set($lucene = $xwiki.getPlugin("lucene")) #if($lucene) #set($wikinames = "xwiki") #set($languages = "default,en,de") #set($firstIndex = $request.getParameter("firstIndex")) #if(!$firstIndex) #set($firstIndex = "1") #end #set($searchresults = $lucene.getSearchResults($query, $wikinames, $languages, $xwiki)) #set($results = $searchresults.getResults($firstIndex,$itemsPerPage)) #if($results.size()>0) #set($lastIndex=$searchresults.getEndIndex($firstIndex, $itemsPerPage)) #if($searchresults.hitcount==1) ##{pre} $msg.get("oneresult"):{/pre} #else ##{pre}$msg.get("results") $firstIndex - $lastIndex $msg.get("of") ${searchresults.hitcount}:{/pre} #if($searchresults.hasPrevious($firstIndex)) [previous page>${doc.web}.${doc.name}?text=$query&firstIndex=$searchresults.getPreviousIndex($firstIndex,$itemsPerPage)] #end #if($searchresults.hasNext($firstIndex,$itemsPerPage)) [next page>${doc.web}.${doc.name}?text=$query&firstIndex=$searchresults.getNextIndex($firstIndex,$itemsPerPage)] #end #end <table width="100%" class="grid" cellSpacing=0 cellpadding="5" border="1"> <tr> <th>Result</th> <th width="100">Date</th> <th width="150">Last Author</th> <th width="100">Score</th> </tr> #foreach($result in $results) #if($result.type=='wikipage') <tr> #if($xwiki.isVirtual()) <td align=left>[${result.wiki}:${result.web}.${result.name}]</td> #else <td align=left>[${result.web}.${result.name}]</td> #end <td>$xwiki.formatDate($result.date, "d. MMM yyyy")</td> <td>$xwiki.getUserName($result.author)</td> <td> #set($resval=$result.score*100) #if($resval>10) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>25) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>50) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>70) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>90) /xwiki/skins/lgs/16-star-hot.png #end ${resval}% </td> </tr> #elseif($result.type=='attachment') <tr> <td align=left> ${result.url} /xwiki/skins/lgs/disk.png ${result.filename} \\ Attachment of [${result.web}.${result.name}]</td> <td>$xwiki.formatDate($result.date, "d. MMM yyyy")</td> <td>$xwiki.getUserName($result.author)</td> <td> #set($resval=$result.score*100) #if($resval>10) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>25) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>50) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>70) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>90) /xwiki/skins/lgs/16-star-hot.png #end ${resval}% </td> </tr> #end </tr> #end #else $msg.get("noresults") #end </table> \\ #else lucene plugin not found #end #end -- View this message in context: http://www.nabble.com/Costumized-Lucene-Search-Page-tf3605463.html#a10073014 Sent from the XWiki- Dev mailing list archive at Nabble.com.
Hi Michael/Jens, Thanks for your contribution Michael. 1) I didn't know Jens had a page documenting the Lucene plugin. The page is quite nice and much better than ours at http://www.xwiki.org/ xwiki/bin/view/Code/LucenePlugin. Jens, would you mind if we merge the content of your page in the one at xwiki.org? Also, my understanding is that you donated the Lucene plugin to the XWiki project some time back. Is that correct? If so maybe we could deprecate your lucene doc page (once and if you agree to merge the content with the one on xwiki.org). WDYT? 2) Michael, In Velocity, looping is done with foreach. That's the only loop there is I think. 3) Michael, what would be nice would be if you could add your code as a Code Snippet on xwiki.org: http://www.xwiki.org/xwiki/bin/view/Code/ Snippets (there's a "Add snippet" on the right). In that manner we'll be able to add a link to it from the Lucene plugin. It would be nice if you could put a screenshot of the result on the Code Snippet page so that users can see how it looks and decide if they want to use your snippet. WDYT? Thanks a lot -Vincent On Apr 19, 2007, at 9:12 AM, Michael Guntli wrote:
With RC1 lucene seems to work again, so i have costumized the existing search form from jkraemer (http://www.jkraemer.net/static/maven/xwiki/plugins/lucene-plugin/ install.html)
But keep attention: it's just a quick&dirty example to display the results in a table ;-) As im not very familiar with velocity, the code is quite ugly! (for example i didn't find a while loop to output the number of stars for score- quality, so i did it with if, if, if..)
it still has some bugs: * if you search for a regular expression (e.g. win*), then the query for the next page will be win</strong> * non wiki-documents and non-attachments will be hidden from the results, so it could happen that you see an empty page with a link to the next results (that's because searchresults.hitcount returns all results, also the hidden ones..) * many more.. * icons are hard-coded.. (/skins/lgs/*.png)
You can get the icons for free from famfamfam: http://www.famfamfam.com/lab/icons/silk/
--------------------------- Searchform.vm: 1 Search #set($query = $request.getParameter("text")) #if(!$query) #set($query = "") #end #warning("This is the new lucene search engine.\\ If you experience any problems, try to use the default xwiki [Search>WebSearch?text=$query]..") #set($itemsPerPage = "30") #set($doRebuild = $request.getParameter("rebuild")) #if($doRebuild=="yes") #set($lucene = $xwiki.getPlugin("lucene")) #if($lucene) #set($documentCount = $lucene.rebuildIndex($xwiki,$context)) #if(${documentCount}>=0) Started index rebuild with $documentCount documents. Will take some time depending on the number of pages/attachments. #else Index rebuild failed. #end #end #else #if($xwiki.hasAdminRights()) [rebuild Index>${doc.web}.${doc.name}?rebuild=yes] #end #end
{pre} <form action="$doc.name" method="post"> <input type="text" name="text" value="$query" /> <input type="submit" value="Search"/> </form> {/pre}
#if($query != "") #set($lucene = $xwiki.getPlugin("lucene")) #if($lucene) #set($wikinames = "xwiki") #set($languages = "default,en,de") #set($firstIndex = $request.getParameter("firstIndex")) #if(!$firstIndex) #set($firstIndex = "1") #end #set($searchresults = $lucene.getSearchResults($query, $wikinames, $languages, $xwiki)) #set($results = $searchresults.getResults($firstIndex, $itemsPerPage)) #if($results.size()>0) #set($lastIndex=$searchresults.getEndIndex($firstIndex, $itemsPerPage)) #if($searchresults.hitcount==1) ##{pre} $msg.get("oneresult"):{/pre} #else ##{pre}$msg.get("results") $firstIndex - $lastIndex $msg.get("of") ${searchresults.hitcount}:{/pre}
#if($searchresults.hasPrevious($firstIndex)) [previous page>${doc.web}.${doc.name}?text=$query&firstIndex= $searchresults.getPreviousIndex($firstIndex,$itemsPerPage)] #end #if($searchresults.hasNext($firstIndex,$itemsPerPage)) [next page>${doc.web}.${doc.name}?text=$query&firstIndex= $searchresults.getNextIndex($firstIndex,$itemsPerPage)] #end #end
<table width="100%" class="grid" cellSpacing=0 cellpadding="5" border="1"> <tr> <th>Result</th> <th width="100">Date</th> <th width="150">Last Author</th> <th width="100">Score</th> </tr> #foreach($result in $results) #if($result.type=='wikipage') <tr> #if($xwiki.isVirtual()) <td align=left>[${result.wiki}:${result.web}.${result.name}]</td> #else <td align=left>[${result.web}.${result.name}]</td> #end <td>$xwiki.formatDate($result.date, "d. MMM yyyy")</td> <td>$xwiki.getUserName($result.author)</td> <td> #set($resval=$result.score*100) #if($resval>10) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>25) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>50) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>70) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>90) /xwiki/skins/lgs/16-star-hot.png #end ${resval}% </td> </tr> #elseif($result.type=='attachment') <tr> <td align=left> ${result.url} /xwiki/skins/lgs/disk.png ${result.filename} \\ Attachment of [${result.web}.${result.name}]</td> <td>$xwiki.formatDate($result.date, "d. MMM yyyy")</td> <td>$xwiki.getUserName($result.author)</td> <td> #set($resval=$result.score*100) #if($resval>10) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>25) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>50) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>70) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>90) /xwiki/skins/lgs/16-star-hot.png #end ${resval}% </td> </tr> #end </tr> #end #else $msg.get("noresults") #end </table> \\ #else lucene plugin not found #end #end
On Apr 19, 2007, at 9:36 AM, Vincent Massol wrote:
Hi Michael/Jens,
Thanks for your contribution Michael.
1) I didn't know Jens had a page documenting the Lucene plugin. The page is quite nice and much better than ours at http:// www.xwiki.org/xwiki/bin/view/Code/LucenePlugin.
Jens, would you mind if we merge the content of your page in the one at xwiki.org? Also, my understanding is that you donated the Lucene plugin to the XWiki project some time back. Is that correct? If so maybe we could deprecate your lucene doc page (once and if you agree to merge the content with the one on xwiki.org). WDYT?
2) Michael, In Velocity, looping is done with foreach. That's the only loop there is I think.
3) Michael, what would be nice would be if you could add your code as a Code Snippet on xwiki.org: http://www.xwiki.org/xwiki/bin/view/ Code/Snippets (there's a "Add snippet" on the right). In that manner we'll be able to add a link to it from the Lucene plugin. It would be nice if you could put a screenshot of the result on the Code Snippet page so that users can see how it looks and decide if they want to use your snippet. WDYT?
4) You can remove the hardcoding by getting the icons from the current page using: $doc.getAttachmentURL("16-star-hot.png") Then users will simply need to attach the icons to this search page. Thanks -Vincent
Thanks a lot -Vincent
On Apr 19, 2007, at 9:12 AM, Michael Guntli wrote:
With RC1 lucene seems to work again, so i have costumized the existing search form from jkraemer (http://www.jkraemer.net/static/maven/xwiki/plugins/lucene-plugin/ install.html)
But keep attention: it's just a quick&dirty example to display the results in a table ;-) As im not very familiar with velocity, the code is quite ugly! (for example i didn't find a while loop to output the number of stars for score- quality, so i did it with if, if, if..)
it still has some bugs: * if you search for a regular expression (e.g. win*), then the query for the next page will be win</strong> * non wiki-documents and non-attachments will be hidden from the results, so it could happen that you see an empty page with a link to the next results (that's because searchresults.hitcount returns all results, also the hidden ones..) * many more.. * icons are hard-coded.. (/skins/lgs/*.png)
You can get the icons for free from famfamfam: http://www.famfamfam.com/lab/icons/silk/
--------------------------- Searchform.vm: 1 Search #set($query = $request.getParameter("text")) #if(!$query) #set($query = "") #end #warning("This is the new lucene search engine.\\ If you experience any problems, try to use the default xwiki [Search>WebSearch?text=$query]..") #set($itemsPerPage = "30") #set($doRebuild = $request.getParameter("rebuild")) #if($doRebuild=="yes") #set($lucene = $xwiki.getPlugin("lucene")) #if($lucene) #set($documentCount = $lucene.rebuildIndex($xwiki,$context)) #if(${documentCount}>=0) Started index rebuild with $documentCount documents. Will take some time depending on the number of pages/attachments. #else Index rebuild failed. #end #end #else #if($xwiki.hasAdminRights()) [rebuild Index>${doc.web}.${doc.name}?rebuild=yes] #end #end
{pre} <form action="$doc.name" method="post"> <input type="text" name="text" value="$query" /> <input type="submit" value="Search"/> </form> {/pre}
#if($query != "") #set($lucene = $xwiki.getPlugin("lucene")) #if($lucene) #set($wikinames = "xwiki") #set($languages = "default,en,de") #set($firstIndex = $request.getParameter("firstIndex")) #if(!$firstIndex) #set($firstIndex = "1") #end #set($searchresults = $lucene.getSearchResults($query, $wikinames, $languages, $xwiki)) #set($results = $searchresults.getResults($firstIndex, $itemsPerPage)) #if($results.size()>0) #set($lastIndex=$searchresults.getEndIndex($firstIndex, $itemsPerPage)) #if($searchresults.hitcount==1) ##{pre} $msg.get("oneresult"):{/pre} #else ##{pre}$msg.get("results") $firstIndex - $lastIndex $msg.get ("of") ${searchresults.hitcount}:{/pre}
#if($searchresults.hasPrevious($firstIndex)) [previous page>${doc.web}.${doc.name}?text=$query&firstIndex= $searchresults.getPreviousIndex($firstIndex,$itemsPerPage)] #end #if($searchresults.hasNext($firstIndex,$itemsPerPage)) [next page>${doc.web}.${doc.name}?text=$query&firstIndex= $searchresults.getNextIndex($firstIndex,$itemsPerPage)] #end #end
<table width="100%" class="grid" cellSpacing=0 cellpadding="5" border="1"> <tr> <th>Result</th> <th width="100">Date</th> <th width="150">Last Author</th> <th width="100">Score</th> </tr> #foreach($result in $results) #if($result.type=='wikipage') <tr> #if($xwiki.isVirtual()) <td align=left>[${result.wiki}:${result.web}.${result.name}]</ td> #else <td align=left>[${result.web}.${result.name}]</td> #end <td>$xwiki.formatDate($result.date, "d. MMM yyyy")</td> <td>$xwiki.getUserName($result.author)</td> <td> #set($resval=$result.score*100) #if($resval>10) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>25) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>50) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>70) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>90) /xwiki/skins/lgs/16-star-hot.png #end ${resval}% </td> </tr> #elseif($result.type=='attachment') <tr> <td align=left> ${result.url} /xwiki/skins/lgs/disk.png ${result.filename} \\ Attachment of [${result.web}.${result.name}]</td> <td>$xwiki.formatDate($result.date, "d. MMM yyyy")</td> <td>$xwiki.getUserName($result.author)</td> <td> #set($resval=$result.score*100) #if($resval>10) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>25) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>50) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>70) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>90) /xwiki/skins/lgs/16-star-hot.png #end ${resval}% </td> </tr> #end </tr> #end #else $msg.get("noresults") #end </table> \\ #else lucene plugin not found #end #end
Thanks. I'll take a look at my code to modify it and then i'll put it on code snippet page.. On Apr 19, 2007, at 9:36 AM, Vincent Massol wrote:
3) Michael, what would be nice would be if you could add your code as a Code Snippet on xwiki.org: http://www.xwiki.org/xwiki/bin/view/ Code/Snippets (there's a "Add snippet" on the right). In that manner we'll be able to add a link to it from the Lucene plugin. It would be nice if you could put a screenshot of the result on the Code Snippet page so that users can see how it looks and decide if they want to use your snippet. WDYT?
4) You can remove the hardcoding by getting the icons from the current page using: $doc.getAttachmentURL("16-star-hot.png") Then users will simply need to attach the icons to this search page. -- View this message in context: http://www.nabble.com/Costumized-Lucene-Search-Page-tf3605463.html#a10073399 Sent from the XWiki- Dev mailing list archive at Nabble.com.
Ok, i've added the code to the code snipplets. http://www.xwiki.org/xwiki/bin/view/Code/LuceneSearchPage Seems that the lucene plugin isn't enabled on the sandbox? This might be nice for the user to see a real example.. Can you enable lucene on the sandbox? http://sandbox.xwiki.org/xwiki/bin/view/Main/LuceneSearch I've also listet some known bugs, maybe someone can have a look at this? Best regards Michael -- View this message in context: http://www.nabble.com/Costumized-Lucene-Search-Page-tf3605463.html#a10092993 Sent from the XWiki- Dev mailing list archive at Nabble.com.
On Apr 20, 2007, at 9:58 AM, Michael Guntli wrote:
Ok, i've added the code to the code snipplets. http://www.xwiki.org/xwiki/bin/view/Code/LuceneSearchPage
very cool, thanks.
Seems that the lucene plugin isn't enabled on the sandbox? This might be nice for the user to see a real example.. Can you enable lucene on the sandbox? http://sandbox.xwiki.org/xwiki/bin/view/Main/LuceneSearch
Yes I think it's a good idea to enable all plugins on the sandbox. However beware that the sandbox content is reset automatically every week or month. Raffaello, do you think you could enable the ZipExplorer and the Lucene plugins for sandbox.xwiki.org? Thanks -Vincent
I've also listet some known bugs, maybe someone can have a look at this?
Best regards Michael
Hi! Glad the Lucene plugin is still in use :-) On Thu, Apr 19, 2007 at 09:36:05AM +0200, Vincent Massol wrote:
Hi Michael/Jens,
Thanks for your contribution Michael.
1) I didn't know Jens had a page documenting the Lucene plugin. The page is quite nice and much better than ours at http://www.xwiki.org/ xwiki/bin/view/Code/LucenePlugin.
Jens, would you mind if we merge the content of your page in the one at xwiki.org? Also, my understanding is that you donated the Lucene plugin to the XWiki project some time back. Is that correct? If so maybe we could deprecate your lucene doc page (once and if you agree to merge the content with the one on xwiki.org). WDYT?
Please feel free to do so. I also can add a pointer to the new location to my site. And yes, I released the plugin under LGPL and moved it into the official svn repository so you can do whatever you like with it ;-) Jens -- Jens Krämer http://www.jkraemer.net/
Hi Jens ! The Lucene plugin is still in use and has made great progress.. It's indexing all properties now, which allows to run much more complex queries. You can see it in action on curriki.org at http://www.curriki.org/xwiki/bin/view/Main/BrowseSearch?area=&brsqry=course Ludovic Jens Kraemer a écrit :
Hi!
Glad the Lucene plugin is still in use :-)
On Thu, Apr 19, 2007 at 09:36:05AM +0200, Vincent Massol wrote:
Hi Michael/Jens,
Thanks for your contribution Michael.
1) I didn't know Jens had a page documenting the Lucene plugin. The page is quite nice and much better than ours at http://www.xwiki.org/ xwiki/bin/view/Code/LucenePlugin.
Jens, would you mind if we merge the content of your page in the one at xwiki.org? Also, my understanding is that you donated the Lucene plugin to the XWiki project some time back. Is that correct? If so maybe we could deprecate your lucene doc page (once and if you agree to merge the content with the one on xwiki.org). WDYT?
Please feel free to do so. I also can add a pointer to the new location to my site.
And yes, I released the plugin under LGPL and moved it into the official svn repository so you can do whatever you like with it ;-)
Jens
------------------------------------------------------------------------
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
-- Ludovic Dubost Blog: http://www.ludovic.org/blog/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost AIM: nvludo Yahoo: ludovic
Hi, Thanks. Here is another sample of the Lucene plugin (but specific to Curriki). That can help you to understand what you can do with it : http://www.curriki.org/xwiki/bin/view/Main/BrowseSearch?brsqry=mit and here is the code : http://www.curriki.org/xwiki/bin/view/Main/BrowseSearch?xpage=code jeremi On 4/19/07, Michael Guntli <[email protected]> wrote:
With RC1 lucene seems to work again, so i have costumized the existing search form from jkraemer (http://www.jkraemer.net/static/maven/xwiki/plugins/lucene-plugin/install.htm...)
But keep attention: it's just a quick&dirty example to display the results in a table ;-) As im not very familiar with velocity, the code is quite ugly! (for example i didn't find a while loop to output the number of stars for score-quality, so i did it with if, if, if..)
it still has some bugs: * if you search for a regular expression (e.g. win*), then the query for the next page will be win</strong> * non wiki-documents and non-attachments will be hidden from the results, so it could happen that you see an empty page with a link to the next results (that's because searchresults.hitcount returns all results, also the hidden ones..) * many more.. * icons are hard-coded.. (/skins/lgs/*.png)
You can get the icons for free from famfamfam: http://www.famfamfam.com/lab/icons/silk/
--------------------------- Searchform.vm: 1 Search #set($query = $request.getParameter("text")) #if(!$query) #set($query = "") #end #warning("This is the new lucene search engine.\\ If you experience any problems, try to use the default xwiki [Search>WebSearch?text=$query]..") #set($itemsPerPage = "30") #set($doRebuild = $request.getParameter("rebuild")) #if($doRebuild=="yes") #set($lucene = $xwiki.getPlugin("lucene")) #if($lucene) #set($documentCount = $lucene.rebuildIndex($xwiki,$context)) #if(${documentCount}>=0) Started index rebuild with $documentCount documents. Will take some time depending on the number of pages/attachments. #else Index rebuild failed. #end #end #else #if($xwiki.hasAdminRights()) [rebuild Index>${doc.web}.${doc.name}?rebuild=yes] #end #end
{pre} <form action="$doc.name" method="post"> <input type="text" name="text" value="$query" /> <input type="submit" value="Search"/> </form> {/pre}
#if($query != "") #set($lucene = $xwiki.getPlugin("lucene")) #if($lucene) #set($wikinames = "xwiki") #set($languages = "default,en,de") #set($firstIndex = $request.getParameter("firstIndex")) #if(!$firstIndex) #set($firstIndex = "1") #end #set($searchresults = $lucene.getSearchResults($query, $wikinames, $languages, $xwiki)) #set($results = $searchresults.getResults($firstIndex,$itemsPerPage)) #if($results.size()>0) #set($lastIndex=$searchresults.getEndIndex($firstIndex, $itemsPerPage)) #if($searchresults.hitcount==1) ##{pre} $msg.get("oneresult"):{/pre} #else ##{pre}$msg.get("results") $firstIndex - $lastIndex $msg.get("of") ${searchresults.hitcount}:{/pre}
#if($searchresults.hasPrevious($firstIndex)) [previous page>${doc.web}.${doc.name}?text=$query&firstIndex=$searchresults.getPreviousIndex($firstIndex,$itemsPerPage)] #end #if($searchresults.hasNext($firstIndex,$itemsPerPage)) [next page>${doc.web}.${doc.name}?text=$query&firstIndex=$searchresults.getNextIndex($firstIndex,$itemsPerPage)] #end #end
<table width="100%" class="grid" cellSpacing=0 cellpadding="5" border="1"> <tr> <th>Result</th> <th width="100">Date</th> <th width="150">Last Author</th> <th width="100">Score</th> </tr> #foreach($result in $results) #if($result.type=='wikipage') <tr> #if($xwiki.isVirtual()) <td align=left>[${result.wiki}:${result.web}.${result.name}]</td> #else <td align=left>[${result.web}.${result.name}]</td> #end <td>$xwiki.formatDate($result.date, "d. MMM yyyy")</td> <td>$xwiki.getUserName($result.author)</td> <td> #set($resval=$result.score*100) #if($resval>10) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>25) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>50) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>70) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>90) /xwiki/skins/lgs/16-star-hot.png #end ${resval}% </td> </tr> #elseif($result.type=='attachment') <tr> <td align=left> ${result.url} /xwiki/skins/lgs/disk.png ${result.filename} \\ Attachment of [${result.web}.${result.name}]</td> <td>$xwiki.formatDate($result.date, "d. MMM yyyy")</td> <td>$xwiki.getUserName($result.author)</td> <td> #set($resval=$result.score*100) #if($resval>10) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>25) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>50) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>70) /xwiki/skins/lgs/16-star-hot.png #end #if($resval>90) /xwiki/skins/lgs/16-star-hot.png #end ${resval}% </td> </tr> #end </tr> #end #else $msg.get("noresults") #end </table> \\ #else lucene plugin not found #end #end -- View this message in context: http://www.nabble.com/Costumized-Lucene-Search-Page-tf3605463.html#a10073014 Sent from the XWiki- Dev mailing list archive at Nabble.com.
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
-- Jeremi Joslin (http://www.jeremi.info) skype: jeremi23 - jabber: [email protected] http://www.xwiki.com - http://www.pengyou-project.info
participants (5)
-
Jens Kraemer -
jeremi joslin -
Ludovic Dubost -
Michael Guntli -
Vincent Massol