[Koha-devel] SearchMarc.pm
Chris Cormack
chris at katipo.co.nz
Fri Mar 5 20:59:10 CET 2004
Hi All
Especially Joshua. Ive been thinking on starting work on Query.pm our top
level search module.
And im thinking of using Joshua's SearchMarc.pm module as one (if not its
main) backend.
Heres what im thinking
Query.pm creates an object. On creating the kohaquery
object you pass it a string which describes your search. Pat and Steve were
discussing perhaps using a syntax like googles.
Eg something like
my $query=Query::new("title: elephants (author: johnson | author: tonnesen)")
you then can do things like
$num_of_results=$query->count();
my $results=$query->results(-sortby => 'title', -limit=>10, -offset=>'10');
So the Query module does all the hard work, and then all search.pl needs to
do is craft the search string.
So making new searches, or searching new combinations of data should be easy.
Now joshua has written a module SearchMarc.pm which searches the marc tables
to return data, so I was thinking of using Query.pm to parse the
searchstring and construct the appropriate variables to call catalogsearch
in SearchMarc
Good, Bad, stupid idea?
Chris
--
Chris Cormack Programmer
027 4500 789 Katipo Communications Ltd
chris at katipo.co.nz www.katipo.co.nz
More information about the Koha-devel
mailing list