[Tkl] A canned search

Marc Cromme marc at indexdata.dk
Fri Feb 13 14:31:04 CET 2004

Sigfrid Lundberg - LUB NetLab wrote:

>On Wed, 11 Feb 2004, Marc Cromme wrote:
>>idxpath computer&start=1&syntax=xml&number=6
>I found cclquery when I grepped among the php-files, but not query...
>I've set up my zebra such that it answers on the db/socket, in spite of
>the fact that the database is basically external.
>Having put this in, I get the answer:
>Encoding failed at target unix:/localdisk1/xerxes/service/db/socket
>My search call looks as follows:
>   <xsl:variable name="search" select="document(concat(
>      'tkl-search://unix:/localdisk1/xerxes/service/db/socket?',
>      'query=','@attrset bib1 @or @and @attr 5=101 @attr 1=1012 2003 @attr
>1=5000 accepted @attr 1=1012 @attr 7=2 ',
>      '&amp;start=', '1',
>      '&amp;syntax=xml',
>      '&amp;number=', '500'))"
>      />
>The socket is there, and I have modified my search.xsl, search.tkl and
>authorities/advanced-fields.tkl to reflect my setup.
>What does idxpath computer in the example mean? I've never used the
>unix:socket stuff before starting using tkl. I'm used to syntax like
Sorry for the late answer - have been out  visiting customers.
Just arrived back right now.

It does not matter wether you use a unix socket or a TCP comnnection, do 
not get confused by the hypothetical query I invented - if you have a 
query you can issue on the command line of
the "yaz-client" test application (sitting on the web server machine), it
will also work using the "document('tkl-search:://somequery') " from 
within the  xslt stylesheet.

So, my advice is : get the query understood and processed by
yaz-client, and get the response you'd expect (setting result set to 
XML), then throw it into the XSLT sheet.

The "encoding failed at target" error might smell like an yaz version 
before 2.0.6 - that is the library /usr/lib/libyaz should come from a 
debian package version 2.0.6 or 2.0.7. Check version number, and try 
again with a newer one, if need is (Adam, please correct me if I telling 
nonsense here...)

Hope that resolves your troubles..

Marc Cromme, Indexdata

More information about the TKL mailing list