X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fkcontrol.c;h=d5ef2b0e91f77e6610365b55236f3bc7233ec07e;hb=131e8143a9b8da294d582f0793833679101a2672;hp=7cde52ea5372f02aec9715adac92608f828d88ef;hpb=651974e51cda5f503b3cbecbe11370a329d6b7e4;p=idzebra-moved-to-github.git diff --git a/index/kcontrol.c b/index/kcontrol.c index 7cde52e..d5ef2b0 100644 --- a/index/kcontrol.c +++ b/index/kcontrol.c @@ -1,5 +1,5 @@ -/* $Id: kcontrol.c,v 1.3 2006-07-04 14:10:30 adam Exp $ - Copyright (C) 1995-2005 +/* $Id: kcontrol.c,v 1.7 2007-01-15 15:10:16 adam Exp $ + Copyright (C) 1995-2007 Index Data ApS This file is part of the Zebra server. @@ -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 @@ -56,22 +56,26 @@ static void my_dec(struct rset_key_control *kc) struct rset_key_control *zebra_key_control_create(ZebraHandle zh) { - const char *res_val; struct rset_key_control *kc = xmalloc(sizeof(*kc)); struct context_control *cp = xmalloc(sizeof(*cp)); kc->context = cp; kc->key_size = sizeof(struct it_key); - kc->scope = 2; kc->cmp = key_compare_it; kc->key_logdump_txt = key_logdump_txt; kc->getseq = key_get_seq; - res_val = zebra_get_resource(zh, "segment", 0); - kc->get_segment = 0; - if (res_val && atoi(res_val)) + + 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,