Omit CVS Id. Update copyright year.
[idzebra-moved-to-github.git] / index / kcontrol.c
index e5d2b6b..a277981 100644 (file)
@@ -1,8 +1,5 @@
-/* $Id: kcontrol.c,v 1.2 2006-05-10 08:13:21 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) 1995-2008 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,9 +12,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 <assert.h>
@@ -53,6 +50,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,10 +58,21 @@ 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->key_logdump_txt = key_logdump_txt;
     kc->getseq = key_get_seq;
+
+    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,