[Xapian-discuss] Omega Script

Frank J Bruzzaniti frank.bruzzaniti at gmail.com
Sat Feb 28 16:02:37 GMT 2009


Thomas Viehmann wrote:
> Frank J Bruzzaniti wrote:
>   
>> When I return the names of files from a search result I use $field{url} 
>> which returns \\server\docs\foo.doc
>>     
>
>   
>> What should I do if I only want foo.doc to be displayed?
>>     
> If you want to do it with the current set of commands, using $transform
> might be a good approach. Of course, that might be more difficult if you
> have to cater for lots of different path conventions.
>
> [...]
>
>   
>> And how hard would it be to create new script index commands like 
>> $filename and $path.  If extending omega script is easy/"a good idea" 
>> I'd be happy
>> to write some documentation once I learn how.
>>     
>
> Extending OmegaScript is not that hard (add a few lines to query.cc),
> but I am not sure that with the current implementation it is a good idea
> to try to add a whole bunch of "library functions" to it. Personally, my
> approach to this has been to try to use custom indexing and make do with
> (as far as possible) stock omega, but that may be a matter of taste, too.
>
> Kind regards
>
> T.
>   
Thanks!

One question I had regarding the query template.

I found a function in php that dose what I want called basename().
I wanted to use basename() to extract the filename from $url

I tried adding some php to query template and it doesn't work.

E.g. <?php  echo "Hi";  ?>

Guessing you can't mix in php into template?

Guess the other option would be for me to re-write the default omega 
page as php.
Apart from having another dependency via php-bindings and php, is there 
any other disadvantages/pit falls I'd be looking at?



More information about the Xapian-discuss mailing list