searchquery.tmpl 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. $setmap{prefix,title,S}
  2. $setmap{prefix,link,XLINK}
  3. $set{thousand,$.}$set{decimal,.}$setmap{BN,,Any Country,uk,England,fr,France}
  4. ${
  5. $def{PREV,
  6. $if{$ne{$topdoc,0},<INPUT TYPE=image NAME="&lt;" ALT="&lt;"
  7. SRC="/images/xapian-omega/prev.png" BORDER=0 HEIGHT=30 WIDTH=30>,
  8. <IMG ALT="" SRC="/images/xapian-omega/prevoff.png" HEIGHT=30 WIDTH=30>}
  9. }
  10. $def{NEXT,
  11. $if{$ne{$last,$msize},<INPUT TYPE=image NAME="&gt;" ALT="&gt;"
  12. SRC="/images/xapian-omega/next.png" BORDER=0 HEIGHT=30 WIDTH=30>,
  13. <IMG ALT="" SRC="/images/xapian-omega/nextoff.png" HEIGHT=30 WIDTH=30>}
  14. }
  15. $def{P,<INPUT TYPE=image NAME="$1" VALUE="$1" SRC="/images/xapian-omega/page-$2.png" BORDER=0$opt{a} ALT="$1">}
  16. $def{PAGE,$if{$gt{$1,9},$if{$gt{$1,99},$P{$1,$div{$1,100}}}$P{$1,$mod{$div{$1,10},10}}}$P{$1,$mod{$1,10}}}
  17. $def{S,<IMG SRC="/images/xapian-omega/page-$2s.png"$opt{a} ALT=$1>}
  18. $def{SPAGE,$if{$gt{$1,9},$if{$gt{$1,99},$S{$1,$div{$1,100}}}$S{$1,$mod{$div{$1,10},10}}}$S{$1,$mod{$1,10}}}
  19. }
  20. $def{PREV,$if{$ne{$topdoc,0},<INPUT class="btn btn-default" TYPE=submit NAME="&lt;" VALUE="Previous">}}
  21. $def{PAGE,<INPUT class="btn btn-default" TYPE=submit NAME="[" VALUE="$1">}
  22. $def{SPAGE,<INPUT class="btn btn-default" TYPE=submit NAME="[" VALUE="$1" DISABLED=disabled>}
  23. $def{NEXT,$if{$ne{$last,$msize},<INPUT class="btn btn-default" TYPE=submit NAME="&gt;" VALUE="Next">}}
  24. <p>
  25. <FORM class="container form-inline" role="form" NAME=P METHOD=GET ACTION="$html{$env{CGIURL}}" TARGET="_top">
  26. <div class="row">
  27. <div style="text-align:center" class="form-group col-12 col-centered">
  28. <INPUT class="form-control" placeholder="Search query" NAME=P VALUE="$html{$query}" SIZE=65>
  29. <SELECT class="form-control" NAME=DEFAULTOP>
  30. <OPTION VALUE=or $if{$eq{$defaultop,or},SELECTED}>Matching any words
  31. <OPTION VALUE=and $if{$eq{$defaultop,and},SELECTED}>Matching all words
  32. </SELECT>
  33. <INPUT class="btn btn-default" TYPE=SUBMIT VALUE="Search">
  34. $env{HELPLINK}
  35. </div>
  36. </div>
  37. <div class="row">
  38. <div class="col-12">
  39. <hr>
  40. $or{$html{$error},
  41. $if{$eq{$msize,0},
  42. $if{$query,No documents match your query,
  43. <hr>Searching $nice{$dbsize} documents
  44. },
  45. $if{$not{$msizeexact},
  46. $nice{$add{$topdoc,1}}-$nice{$last} of about $nice{$msize} matches,
  47. $if{$and{$eq{$last,$msize},$eq{$topdoc,0}},
  48. All $nice{$msize} matches,
  49. $nice{$add{$topdoc,1}}$if{$ne{$add{$topdoc,1},$last},-$nice{$last}} of exactly $nice{$msize} matches}
  50. }
  51. $list{$map{$queryterms,$list{$html{$uniq{$unstem{$_}}},<b>,</b>/<b>,</b>}:&nbsp;$nice{$freq{$_}}},Term frequencies: ,$. ,}
  52. <br><small>Search took $time seconds</small>
  53. </div>
  54. </div>
  55. <br/>
  56. <div class="row"><div class="col-12">
  57. <table class="table table-bordered table-striped">
  58. $hitlist{<tr><td valign=top>
  59. ${<IMG SRC="/images/xapian-omega/score-$div{$percentage,10}.png" ALT="$percentage%" HEIGHT=16 WIDTH=32>}
  60. <div title="$percentage%" style='float:left;width:60px;height:10px;border:1px solid black;margin-top:4px;'>
  61. <div style='width:$div{$mul{$percentage,6},10}px; height:10px; background-color: red;'>
  62. </div></div>
  63. <div style='float:left;margin-top:2px;font-size:x-small;'>
  64. <span title="$html{$date{$field{modtime},%Y-%m-%d %H:%M:%S}}">
  65. Modified:<br><b>$html{$date{$field{modtime},%Y-%m-%d}}</b></span><br>
  66. $if{$field{language},Language: <bold>$html{$field{language}}</bold><br>}
  67. $if{$field{size},<span title="$html{$field{size}} bytes">Size: <b>$html{$filesize{$field{size}}}</b></span><br>}
  68. </div>
  69. </td>
  70. <td><B><A HREF="$html{$field{url}}">$html{$or{$field{caption},$field{title},$field{url},Untitled}}</A></B><BR>
  71. <small>$highlight{$field{sample},$terms}$if{$field{sample},...}</small><br>
  72. <small>
  73. $percentage% relevant$. matching:
  74. <i>$list{$map{$terms,$html{$prettyterm{$_}}},$. ,</i> and <i>}</i></small>${for lynx:}<p></td></tr>}
  75. </table>
  76. </div></div>
  77. <br />
  78. <div style="text-align:center">
  79. ${suppress next, prev, and page links if there's only one page}
  80. $if{$ne{$lastpage,1},
  81. $set{a,$if{$opt{pagelink_height}, HEIGHT=$opt{pagelink_height}}$if{$opt{pagelink_width}, WIDTH=$opt{pagelink_width}}}
  82. ${1-W ... X-(this)-Y ...}
  83. $set{w,$min{3,$add{$thispage,-1}}}
  84. $set{x,$max{$add{$opt{w},1},$add{$thispage,-3}}}
  85. $set{y,$min{$lastpage,$add{$thispage,8}}}
  86. $PREV
  87. $map{$range{1,$opt{w}},$PAGE{$_}}
  88. $if{$ne{$add{$opt{w},1},$opt{x}},...}
  89. $map{$range{$opt{x},$add{$thispage,-1}},$PAGE{$_}}
  90. $SPAGE{$thispage}
  91. $map{$range{$add{$thispage,1},$opt{y}},$PAGE{$_}}
  92. $if{$ne{$opt{y},$lastpage},...}
  93. $NEXT
  94. }
  95. }}
  96. </div><br />
  97. $if{$dbname,<INPUT TYPE=hidden NAME=DB VALUE="$html{$dbname}">}
  98. $if{$ne{$topdoc,0},<INPUT TYPE=hidden NAME=TOPDOC VALUE=$topdoc>}
  99. $if{$ne{$hitsperpage,10},<INPUT TYPE=hidden NAME=HITSPERPAGE VALUE=$hitsperpage>}
  100. $if{$fmt,<INPUT TYPE=hidden NAME=FMT VALUE="$html{$fmt}">}
  101. $if{$cgi{COLLAPSE},<INPUT TYPE=hidden NAME=COLLAPSE VALUE="$html{$cgi{COLLAPSE}}">}
  102. $if{$queryterms,<INPUT TYPE=hidden NAME=xP VALUE="$html{$queryterms}">}
  103. <INPUT TYPE=hidden NAME=xDB VALUE="$html{$dbname}">
  104. <INPUT TYPE=hidden NAME=xFILTERS VALUE="$html{$filters}">
  105. $list{$relevants,<INPUT TYPE=hidden NAME=R VALUE=",.,">}
  106. $if{$cgi{THRESHOLD},<INPUT TYPE=hidden NAME=THRESHOLD VALUE="$html{$cgi{THRESHOLD}}">}
  107. </FORM>
  108. <hr><div align=right><i><small><a href="http://www.xapian.org/">$html{$version}</a></small></i></div>