-/* $Id: zebraapi.c,v 1.223 2006-06-27 11:56:28 adam Exp $
+/* $Id: zebraapi.c,v 1.230 2006-10-12 13:06:00 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
for more details.
You should have received a copy of the GNU General Public License
-along with Zebra; see the file LICENSE.zebra. If not, write to the
-Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
*/
#include <assert.h>
zh->shadow_enable = 1;
zh->m_staticrank = 0;
+ zh->m_segment_indexing = 0;
default_encoding = res_get_def(zh->session_res, "encoding", "ISO-8859-1");
if (res_get_int(zh->res, "staticrank", &zh->m_staticrank) == ZEBRA_OK)
yaz_log(YLOG_LOG, "static rank set and is %d", zh->m_staticrank);
}
+ if (zh->res)
+ {
+ if (res_get_int(zh->res, "segment", &zh->m_segment_indexing) ==
+ ZEBRA_OK)
+ {
+ yaz_log(YLOG_DEBUG, "segment indexing set and is %d",
+ zh->m_segment_indexing);
+ }
+ }
}
void map_basenames_func (void *vp, const char *name, const char *value)
return ZEBRA_FAIL;
}
}
- res = rpn_scan (zh, stream, zapt, attributeset,
- zh->num_basenames, zh->basenames, position,
- num_entries, entries, is_partial, limit_rset, 0);
- zebra_end_read (zh);
+ res = rpn_scan(zh, stream, zapt, attributeset,
+ zh->num_basenames, zh->basenames, position,
+ num_entries, entries, is_partial, limit_rset);
+ zebra_end_read(zh);
return res;
}
if (zh->reg->isamb)
{
int db_ord;
- zebraExplain_curDatabase (zh->reg->zei, db);
- db_ord = zebraExplain_get_database_ord(zh->reg->zei);
- dict_delete_subtree_ord(zh->reg->matchDict, db_ord,
- 0 /* handle */, 0 /* func */);
- zebraExplain_trav_ord(zh->reg->zei, zh, delete_SU_handle);
- zebraExplain_removeDatabase(zh->reg->zei, zh);
+ if (zebraExplain_curDatabase (zh->reg->zei, db))
+ {
+ zebra_setError(zh, YAZ_BIB1_DATABASE_DOES_NOT_EXIST, db);
+ ret = ZEBRA_FAIL;
+ }
+ else
+ {
+ db_ord = zebraExplain_get_database_ord(zh->reg->zei);
+ dict_delete_subtree_ord(zh->reg->matchDict, db_ord,
+ 0 /* handle */, 0 /* func */);
+ zebraExplain_trav_ord(zh->reg->zei, zh, delete_SU_handle);
+ zebraExplain_removeDatabase(zh->reg->zei, zh);
+ zebra_remove_file_match(zh);
+ }
}
else
{
}
zebra_get_state (zh, &val, &seqno);
+ if (val == 'd')
+ {
+ yaz_log(YLOG_WARN, "previous transaction didn't reach commit");
+ clean_only = 1;
+ }
+
if (rval && *rval)
bf_cache (bfs, rval);
if (bf_commitExists (bfs))
yaz_log (YLOG_DEBUG, "commit start");
bf_commitExec (bfs);
-#ifndef WIN32
- sync ();
-#endif
}
seqno++;
zebra_set_state (zh, 'o', seqno);