<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<font face="Arial">Thank you for the suggestions.... I appreciate your
replies<br>
<br>
@Susan,<br>
I tried the running the ./rebuild_zebra with a '-r' switch, this didn't
help my situation. The command runs successfully and exports the
biblios and rebuilds the index, but it makes no difference to the
availability on the search results.<br>
<br>
@ Laurent<br>
I can't grasp what you are suggesting here. I would like to understand
more about what you mean. <br>
</font>
<blockquote><font face="Arial">"Indeed the index in zebra is created
only when a data is found for this</font><br>
  <font face="Arial">index. Therefore, when you are on a brand new
database, where you donot have</font><br>
  <font face="Arial">any lost item or any date on loan, the index is
not created."<br>
  </font></blockquote>
<font face="Arial">I have imported data from the previous library
system for those books that are currently checked out, I created an
import script to reformat/migrate the issued data into the 'issues'
table. When this table was populated, the corresponding item had its
'onloan' field updated in the 'items' table.&nbsp; Koha itself seems to be
happy with this, but&nbsp; the search screen is not :( <br>
<br>
I have attached two CSV files containing a random 30 records from these
two tables.<br>
<br>
I think I have missed something, can I trigger Zebra to index the
availability by inserting the biblios into the zebraqueue table in
Koha? Is this a process that has been missed by manually inserting my
data into the issues table?<br>
</font><font face="Arial"><br>
</font>
<pre class="moz-signature" cols="72">Regards,
Scott Daniels

TechnologyWise Ltd, Tauranga, NZ
<a class="moz-txt-link-abbreviated" href="mailto:scott@tw.co.nz">scott@tw.co.nz</a>
ph: +64 (0)7 571 1060
fax: +64 (0)7 571 1061</pre>
<br>
<br>
LAURENT Henri-Damien wrote:
<blockquote cite="mid:4BCEE94A.1070204@biblibre.com" type="cite">
  <pre wrap="">Le 21/04/2010 06:19, Scott Daniels a &eacute;crit :
  </pre>
  <blockquote type="cite">
    <pre wrap="">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.
    </pre>
  </blockquote>
  <pre wrap=""><!---->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 ?
  </pre>
</blockquote>
</body>
</html>