X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fzebraapi.c;h=84c8e7ae71fe08ada5fb196ccb83d0fa2ed599df;hb=c33ea56e3771c3b80ba66ef8fda3a09cad171ebb;hp=4ef13f81102b46230f4e7cc3b7f81f0fd0b35319;hpb=0af00389d43835ef54928dc22f7d34ae30f3c723;p=idzebra-moved-to-github.git diff --git a/index/zebraapi.c b/index/zebraapi.c index 4ef13f8..84c8e7a 100644 --- a/index/zebraapi.c +++ b/index/zebraapi.c @@ -1,4 +1,4 @@ -/* $Id: zebraapi.c,v 1.220 2006-06-07 10:14:41 adam Exp $ +/* $Id: zebraapi.c,v 1.226 2006-08-29 08:27:59 adam Exp $ Copyright (C) 1995-2006 Index Data ApS @@ -15,9 +15,9 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 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 @@ -140,6 +140,7 @@ ZebraHandle zebra_open(ZebraService zs, Res res) 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"); @@ -181,6 +182,8 @@ ZebraService zebra_start_res (const char *configName, Res def_res, Res over_res) { Res res; + zebra_flock_init(); + if (!log_level_initialized) { log_level = yaz_log_module_level("zebraapi"); @@ -383,7 +386,6 @@ struct zebra_register *zebra_register_open(ZebraService zs, const char *name, /* installing rank classes */ zebraRankInstall (reg, rank_1_class); - zebraRankInstall (reg, rank_zv_class); zebraRankInstall (reg, rank_similarity_class); zebraRankInstall (reg, rank_static_class); @@ -479,7 +481,7 @@ struct zebra_register *zebra_register_open(ZebraService zs, const char *name, { reg->zei = zebraExplain_open(reg->records, reg->dh, res, rw, reg, - explain_extract); + zebra_extract_explain); if (!reg->zei) { yaz_log (YLOG_WARN, "Cannot obtain EXPLAIN information"); @@ -766,6 +768,15 @@ static void zebra_select_register (ZebraHandle zh, const char *new_reg) 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) @@ -1399,15 +1410,15 @@ ZEBRA_RES zebra_admin_exchange_record(ZebraHandle zh, } action = 1; /* make it an insert (if it's an update).. */ } - res = buffer_extract_record (zh, rec_buf, rec_len, - action == 3 ? 1 : 0 /* delete flag */, - 0, /* test mode */ - 0, /* recordType */ - &sysno, - 0, /* match */ - 0, /* fname */ - 0, /* force update */ - 1 /* allow update */ + res = zebra_buffer_extract_record(zh, rec_buf, rec_len, + action == 3 ? 1 : 0 /* delete flag */, + 0, /* test mode */ + 0, /* recordType */ + &sysno, + 0, /* match */ + 0, /* fname */ + 0, /* force update */ + 1 /* allow update */ ); if (res == ZEBRA_FAIL) { @@ -2020,7 +2031,7 @@ static ZEBRA_RES zebra_commit_ex(ZebraHandle zh, int clean_only) zebra_lock_w(zh->lock_shadow); bf_commitClean (bfs, rval); - zebra_unlock (zh->lock_normal); + zebra_unlock (zh->lock_shadow); } else { @@ -2221,14 +2232,14 @@ ZEBRA_RES zebra_insert_record(ZebraHandle zh, if (zebra_begin_trans(zh, 1) == ZEBRA_FAIL) return ZEBRA_FAIL; - res = buffer_extract_record (zh, buf, buf_size, - 0, /* delete_flag */ - 0, /* test_mode */ - recordType, - sysno, - match, fname, - 0, - 0); /* allow_update */ + res = zebra_buffer_extract_record(zh, buf, buf_size, + 0, /* delete_flag */ + 0, /* test_mode */ + recordType, + sysno, + match, fname, + 0, + 0); /* allow_update */ if (zebra_end_trans(zh) != ZEBRA_OK) { yaz_log(YLOG_WARN, "zebra_end_trans failed"); @@ -2258,14 +2269,14 @@ ZEBRA_RES zebra_update_record (ZebraHandle zh, if (zebra_begin_trans(zh, 1) == ZEBRA_FAIL) return ZEBRA_FAIL; - res = buffer_extract_record (zh, buf, buf_size, - 0, /* delete_flag */ - 0, /* test_mode */ - recordType, - sysno, - match, fname, - force_update, - 1); /* allow_update */ + res = zebra_buffer_extract_record(zh, buf, buf_size, + 0, /* delete_flag */ + 0, /* test_mode */ + recordType, + sysno, + match, fname, + force_update, + 1); /* allow_update */ if (zebra_end_trans(zh) != ZEBRA_OK) { yaz_log(YLOG_WARN, "zebra_end_trans failed"); @@ -2294,14 +2305,14 @@ ZEBRA_RES zebra_delete_record (ZebraHandle zh, if (zebra_begin_trans(zh, 1) == ZEBRA_FAIL) return ZEBRA_FAIL; - res = buffer_extract_record (zh, buf, buf_size, - 1, /* delete_flag */ - 0, /* test_mode */ - recordType, - sysno, - match,fname, - force_update, - 1); /* allow_update */ + res = zebra_buffer_extract_record(zh, buf, buf_size, + 1, /* delete_flag */ + 0, /* test_mode */ + recordType, + sysno, + match,fname, + force_update, + 1); /* allow_update */ if (zebra_end_trans(zh) != ZEBRA_OK) { yaz_log(YLOG_WARN, "zebra_end_trans failed");