X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=index%2Fkcontrol.c;h=0317d0377bdacaee7c3cd6c9c6a4022cf52f4b8a;hp=ad7f81f38fccb916ad08d8588bb7025687cd181a;hb=354f1142c4cc8c59b6f1170b95caec40bfe4d8c0;hpb=0e898c0c6183c6dd9701286f6a4ac9b734c9bdbb diff --git a/index/kcontrol.c b/index/kcontrol.c index ad7f81f..0317d03 100644 --- a/index/kcontrol.c +++ b/index/kcontrol.c @@ -1,8 +1,5 @@ -/* $Id: kcontrol.c,v 1.1 2005-05-03 09:11:34 adam Exp $ - Copyright (C) 1995-2005 - Index Data ApS - -This file is part of the Zebra server. +/* This file is part of the Zebra server. + Copyright (C) 1994-2011 Index Data Zebra is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -15,11 +12,14 @@ 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 + */ +#if HAVE_CONFIG_H +#include +#endif #include #include "index.h" @@ -53,6 +53,7 @@ static void my_dec(struct rset_key_control *kc) } } + struct rset_key_control *zebra_key_control_create(ZebraHandle zh) { struct rset_key_control *kc = xmalloc(sizeof(*kc)); @@ -60,11 +61,22 @@ struct rset_key_control *zebra_key_control_create(ZebraHandle zh) kc->context = cp; kc->key_size = sizeof(struct it_key); - kc->scope = 2; - kc->cmp = key_compare_it; + kc->cmp = key_compare; kc->key_logdump_txt = key_logdump_txt; kc->getseq = key_get_seq; - zebra_limit_for_rset(zh->m_limit, + + if (zh->m_segment_indexing) + { + kc->scope = 3; /* segment + seq is "same" record */ + kc->get_segment = key_get_segment; + } + else + { + kc->scope = 2; /* seq is "same" record */ + kc->get_segment = 0; + } + + zebra_limit_for_rset(zh->m_limit, &kc->filter_func, &cp->filter_destroy, &kc->filter_data); @@ -74,3 +86,12 @@ struct rset_key_control *zebra_key_control_create(ZebraHandle zh) return kc; } +/* + * Local variables: + * c-basic-offset: 4 + * c-file-style: "Stroustrup" + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ +