[Koha-zebra] Koha & zebra (continuing to try to understand...)

Mike Taylor mike at miketaylor.org.uk
Wed Aug 10 10:59:16 CEST 2005


> Date: Tue, 09 Aug 2005 14:32:50 +0200
> From: Paul POULAIN <paul.poulain at free.fr>
> 
>> From the moment you have a Zebra database, you can use the
>> Net::Z3950 module to do arbitrary searching in it.  Isn't that what
>> you need?
> 
> In Koha 2.2, the search is done through an API that is really specific. 
> It's a sub called SearchMarc, where that contains 5 arrays :
> 1- the field you want to search on
> 2- the operator (=, >, <, contains...)
> 3- the value you want to search for
> 4- if you want a 'not'
> 5- if the line is 'and'-ed or 'or'-ed with the previous one
> 
> Then, with those array, I build a sql request & run it.

I see.  I agree that this is not the most flexible approach, _but_ it
would be very each to change this to build a Z39.50 PQF query --
	http://indexdata.com/yaz/doc/tools.tkl#PQF

Handing the and/or/not stuff should not present much of a challenge,
either.

You'll need to make tables mapping: the field you want to search on
into a BIB-1 type 1 attribute, and the operator (=, >, <, contains...)
into a BIB-1 type 2 attribute.  Not hard.

That should give you a low-rent route into sanity-testing the
Zebra-based database before you do the bigger job of restructuring the
Kopha querying API.

 _/|_	 ___________________________________________________________________
/o ) \/  Mike Taylor  <mike at miketaylor.org.uk>  http://www.miketaylor.org.uk
)_v__/\  "Microsoft's policy seems to be patching the holes as they get
	 exploited, not as they are found" -- Panu A Kalliokoski.





More information about the Koha-zebra mailing list