{
struct zebra_register *reg;
int record_compression = REC_COMPRESS_NONE;
- const char *recordCompression = 0;
+ const char *compression_str = 0;
const char *profilePath;
int sort_type = ZEBRA_SORT_TYPE_FLAT;
ZEBRA_RES ret = ZEBRA_OK;
zebraRankInstall(reg, rank_similarity_class);
zebraRankInstall(reg, rank_static_class);
- recordCompression = res_get_def(res, "recordCompression", "none");
- if (!strcmp(recordCompression, "none"))
+ compression_str = res_get_def(res, "recordCompression", "none");
+ if (!strcmp(compression_str, "none"))
record_compression = REC_COMPRESS_NONE;
- if (!strcmp(recordCompression, "bzip2"))
+ else if (!strcmp(compression_str, "bzip2"))
record_compression = REC_COMPRESS_BZIP2;
+ else if (!strcmp(compression_str, "zlib"))
+ record_compression = REC_COMPRESS_ZLIB;
+ else
+ {
+ yaz_log(YLOG_FATAL, "invalid recordCompression: %s", compression_str);
+ ret = ZEBRA_FAIL;
+ }
+
+ if (!rec_check_compression_method(record_compression))
+ {
+ yaz_log(YLOG_FATAL, "unsupported recordCompression: %s",
+ compression_str);
+ ret = ZEBRA_FAIL;
+ }
{
const char *index_fname = res_get_def(res, "index", "default.idx");
ZEBRA_RES zebra_repository_update(ZebraHandle zh, const char *path)
{
- return zebra_repository_index(zh, path, action_update);
+ /* Both of these probably need to be thought out better */
+ return zebra_repository_index(zh, path, action_update, NULL);
}
ZEBRA_RES zebra_repository_delete(ZebraHandle zh, const char *path)
{
- return zebra_repository_index(zh, path, action_delete);
+ /* Both of these probably need to be thought out better */
+ return zebra_repository_index(zh, path, action_delete, NULL);
}
ZEBRA_RES zebra_repository_index(ZebraHandle zh, const char *path,
- enum zebra_recctrl_action_t action)
+ enum zebra_recctrl_action_t action, char *useIndexDriver)
{
ASSERTZH;
assert(path);
else
yaz_log(log_level, "update action=%d", (int) action);
- if (zh->m_record_id && !strcmp(zh->m_record_id, "file"))
- return zebra_update_file_match(zh, path);
+ if(!useIndexDriver)
+ {
+ if (zh->m_record_id && !strcmp(zh->m_record_id, "file"))
+ return zebra_update_file_match(zh, path);
+ else
+ return zebra_update_from_path(zh, path, action);
+ }
else
- return zebra_update_from_path(zh, path, action);
+ {
+ /* This is used if we indicate we'll be indexing from the plugin
+ rather than any of the file input systems */
+ zebra_update_from_driver(zh, path, action, useIndexDriver);
+ }
+
}
ZEBRA_RES zebra_repository_show(ZebraHandle zh, const char *path)