[Xapian-discuss] For more UI functionality: OmegaScript, C++or other?

xapian at catcons.co.uk xapian at catcons.co.uk
Tue Apr 26 09:17:39 BST 2011


> -----Original Message-----
> From: Olly Betts [mailto:olly at survex.com] 
> Sent: 20 April 2011 20:11
> To: xapian at catcons.co.uk
> Cc: xapian-discuss at lists.xapian.org
> Subject: Re: [Xapian-discuss] For more UI functionality: 
> OmegaScript, C++or other?
> 
> For date ranges, you just need to set START and/or END CGI parameters.
> 
> For filtering by an extension, you need to use version 1.2.5, and then
> you can pass CGI parameter B=Eodt to return only files with 
> extension .odt
> (or B=Ttext/html for HTML files regardless of the extension - 
> mime-type
> filtering works with older versions too).
> 
> How did you try to find Omega templates on the web?  There isn't a
> standard extension for them, and most of the command names are likely
> to return many unrelated hits.  Also, not everyone is going to make
> their templates public - they're often pretty specific to a site.
> 
> I'm not sure how widely used they are though - it's hard to get good
> evidence on such things.  They can be a bit fiddly to write, depending
> what you're trying to do.  The main annoyance in my experience is the
> deep nesting of curly brackets you can end up.
> 
> Cheers,
>     Olly

Thanks Olly :-)

Your advice supported a successful implementation.  After upgrading to
Xapian 1.2.5, a new template was created, based on the standard "query"
template:

root at CW8vDS:/var/lib/omega/templates# diff -u query docoll 
--- query	2011-04-04 20:48:48.000000000 +0530
+++ query_dev	2011-04-24 13:27:50.435175754 +0530
@@ -50,8 +50,11 @@
 <center>
 <INPUT NAME=P VALUE="$html{$query}" SIZE=65>
 <INPUT TYPE=SUBMIT VALUE="Search">
-<hr>
-$if{,$include{inc/anyalldropbox},$include{inc/anyallradio}}
+<br><br>
+$include{inc/anyalldropbox}
+Dates (YYYYMMDD). Start: <INPUT NAME=START VALUE="$cgi{START}" SIZE=8>
+End: <INPUT NAME=END VALUE="$cgi{END}" SIZE=8>
+File type: $include{inc/filenamedropbox}
 $if{$opt{topterms},
  <div title="Suggested terms to add to your query"
  style="text-align:left;background:#cfc;border:1px solid
green;padding:2px;font:11px verdana$. arial$. helvetica$. sans-serif;">

Here's the helper fragment, filenamedropbox

<SELECT NAME=B>
<OPTION VALUE="" SELECTED>Any
<OPTION VALUE=Edoc>.doc
<OPTION VALUE=Edocx>.docx
<OPTION VALUE=Eodp>.odp
<OPTION VALUE=Eods>.ods
<OPTION VALUE=Eodt>.odt
<OPTION VALUE=Epdf>.pdf
<OPTION VALUE=Epps>.pps
<OPTION VALUE=Eppsx>.ppsx
<OPTION VALUE=Eppt>.ppt
<OPTION VALUE=Ertf>.rtf
<OPTION VALUE=Etxt>.txt
<OPTION VALUE=Exls>.xls
<OPTION VALUE=Exlsx>.xlsx
</SELECT>

An issue with this implementation is that it only allows specifying a single
file type; it would be nice to choose several.  Adding MULTIPLE to the
SELECT tag uses too much vertical space and CHECKBOXes only give on/off
values.  Hmm ... 

Regards finding Omega templates on the web, your observations are correct
and searching for "OmegaScript" with "template" turned up very few actual
templates.

Best

Charles






More information about the Xapian-discuss mailing list