[Koha] Availability (& Zebra?)
LAURENT Henri-Damien
henridamien.laurent at biblibre.com
Thu Apr 22 00:02:18 NZST 2010
Le 21/04/2010 06:19, Scott Daniels a écrit :
> Hi,
>
> I am hoping to get some help with an issue I am having with our
> Koha(v3.00.05.003) installation. This is a new installation and
> biblio/item data has been imported via MARC records. All of our items
> imported correctly, we imported patrons and manually populated the
> issues table with data from the previous system.
>
> The problem we are having is, in the search screen (ie
> cgi-bin/koha/opac-search.pl?q=test).
> The books are ALL reported to be on loan. (Availability: No items
> available: Checked out (1))
>
> The reality is, some are available, some are not. This is ACCURATELY(and
> contradictory to the search screen) reflected in the details screen for
> each book (cgi-bin/koha/opac-detail.pl?biblionumber=733), this will list
> the items with their correct status, available or checked out.
>
> In my research I found that Availability is calculated based on 5
> fields, notforloan(0); damaged(0); itemlost(0); wthdrawn(0) and
> onloan(null). These are all accurately set in our data.
>
> I looked into the code (/usr/share/koha/lib/C4/Search.pm line 1249) and
> it seems that the availability is retrieved from the Zebra index for the
> search screen, and not the data, unless I am misinterpreting the comment.
>
> # 'available' is defined as (items.onloan is NULL) and (items.itemlost = 0)
> # In English:
> # all records not indexed in the onloan register (zebra) and all records
> with a value of lost equal to 0
>
> The scenario of a 'Zebra onloan register' not being populated would
> 'fit' my problem in my mind, as it is only on the search screen that
> availability is wrongly presented.
>
> My question is how can I populate this 'register'?
>
> I have run zebra_rebuild -v -b -w , this has had no effect.
Hi
This problem occurs when you have never had any current loan indexed.
Indeed the index in zebra is created only when a data is found for this
index.
Therefore, when you are on a brand new database, where you donot have
any lost item or any date on loan, the index is not created.
Two workarounds possible :
a) create a fake item attached to a fake biblio with lost and onloan set
to 0000-00-00
b) find a way to enable the search even though the index does not
exist... I know quite a bit of zebra queries, but that would require
some tweaking of the code. idea anyone ?
--
Henri-Damien LAURENT
BibLibre
More information about the Koha
mailing list