[Koha] searching?

Chris Cormack chris at katipo.co.nz
Thu Feb 21 10:05:23 NZDT 2002


On Wed, 2002-02-20 at 15:00, Adam Thick wrote:
> haven't got any problems with the scripts themselves, so no,
> don't have anything in the apache logs...
> thought it might have more to do with the database,  extracted
> some of the SQL from the Search.pm.
> 
> 
> This one works fine, nice and simple :
> 
> "Select * from biblio
> where ((title like 'adam%' or title like '% adam%'))
> or ((author like 'adam%' or author like '% adam%'))
> or ((seriestitle like 'adam%' or seriestitle like '% adam%'))
> or ((notes like 'adam%' or notes like '% adam%'))
> order by title limit 0,10"
> 
> 
> 
> Get no results from this query though.
> There's no data in some of these tables.
> I was wondering whether all data gets entered using the simple Acquistions
> page?
> Or is there extra data that I need to enter?
> 
> "Select * from biblio,bibliosubtitle,biblioitems
> where biblio.biblionumber=biblioitems.biblionumber
> and biblio.biblionumber=bibliosubtitle.biblionumber
> and (((title like 'adam%' or title like '% adam%'))
> or ((subtitle like 'adam%' or subtitle like '% adam%'))
> or ((seriestitle like 'adam%' or seriestitle like '% adam%'))
> or ((biblio.notes like 'adam%' or biblio.notes like '% adam%'))
> or ((biblioitems.notes like 'adam%' or biblioitems.notes like '% adam%')))
> group by biblio.biblionumber"
> 
This is a title search eh?

The second one is the loose search .. i suspect is a bit broken. Well at
the moment it depends on the there being data in the bibliosubtitle
table.

Which may not be being entered by simple acquisitions .. which is a fair
call because if a book doesnt have a subtitle there is no reason to be
put a blank entry in the bibliosubtitle table really.

Ive reworked the query to use a left join instead. If you do a cvs
update u should get the new version. Also ive been playing with keyword
search to speed it up.
It uses Set::Scalar now .. it is faster .. but im not sure i like it.
But if you want to play with it ull need Set::Scalar installed as well.
If not, rename KeywordSearch to KeywordSearch2 and KeywordSearch2 to
KeywordSearch and u'll be back to status quo.

Hope this helps

Chris

-- 
Chris Cormack                                               Programmer
025 500 789                                  Katipo Communications Ltd
chris at katipo.co.nz                                    www.katipo.co.nz




More information about the Koha mailing list