Wiki source code of Search
Last modified by Vincent Massol on 2007/03/22 22:30
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | 1 Search XWiki Reference Projects | ||
| 2 | |||
| 3 | <form action=""> | ||
| 4 | <table> | ||
| 5 | <tr> | ||
| 6 | <td> | ||
| 7 | <input type="text" name="text" value="$!request.text" size="20"/> | ||
| 8 | </td> | ||
| 9 | <td> | ||
| 10 | <input type="submit" value="Search for a Project"/> | ||
| 11 | </td> | ||
| 12 | </tr> | ||
| 13 | </table> | ||
| 14 | </form> | ||
| 15 | |||
| 16 | #set ($allresults = $xwiki.hashMap) | ||
| 17 | |||
| 18 | ## | ||
| 19 | ## Search in text fields | ||
| 20 | ## | ||
| 21 | |||
| 22 | #set ($sql= ", BaseObject as obj, StringProperty as prop where doc.web='References' and obj.name=doc.fullName and prop.id.id = obj.id and prop.value like '%$!request.text%' and obj.name<>'XWiki.ReferenceClassTemplate'") | ||
| 23 | #foreach ($item in $xwiki.searchDocuments($sql , 0, 0)) | ||
| 24 | #set ($discard = $allresults.put($item, '1')) | ||
| 25 | #end | ||
| 26 | |||
| 27 | ## | ||
| 28 | ## Search in big text fields | ||
| 29 | ## | ||
| 30 | |||
| 31 | #set ($sql= ", BaseObject as obj, LargeStringProperty as prop where doc.web='References' and obj.name=doc.fullName and prop.id.id = obj.id and prop.value like '%$!request.text%' and obj.name<>'XWiki.ReferenceClassTemplate'") | ||
| 32 | #foreach ($item in $xwiki.searchDocuments($sql , 0, 0)) | ||
| 33 | #set ($discard = $allresults.put($item, '1')) | ||
| 34 | #end | ||
| 35 | |||
| 36 | #includeInContext("XWiki.Results") |