X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Ftrunc.c;h=19ba2293a22e6438d63e026f5c60649a48219971;hb=3335cd5f7e7af06ac6ed943859c473e092d559a1;hp=689415c08047652cf5d32d7a3781aa710d67744d;hpb=3c67867986bf92288ae3b56d6fd5d39404fa7b7a;p=idzebra-moved-to-github.git diff --git a/index/trunc.c b/index/trunc.c index 689415c..19ba229 100644 --- a/index/trunc.c +++ b/index/trunc.c @@ -1,4 +1,4 @@ -/* $Id: trunc.c,v 1.33 2004-08-11 13:35:04 adam Exp $ +/* $Id: trunc.c,v 1.35 2004-08-19 12:49:14 heikki Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -35,6 +35,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #if NEW_TRUNC #include #endif +#include struct trunc_info { int *ptr; @@ -469,15 +470,41 @@ RSET rset_trunc (ZebraHandle zi, ISAMS_P *isam_p, int no, if (no == 1) { rset_isamb_parms parms; - parms.key_size = sizeof(struct it_key); parms.cmp = key_compare_it; parms.pos = *isam_p; parms.is = zi->reg->isamb; - parms.rset_term = rset_term_create (term, length, flags, + parms.rset_term = rset_term_create (term, length, flags, term_type); return rset_create (rset_kind_isamb, &parms); } +#if 1 + else if (no <10000 ) /* FIXME - hardcoded number */ + { + rset_multior_parms m_parms; + rset_isamb_parms b_parms; + int i; + m_parms.key_size = sizeof(struct it_key); + m_parms.cmp = key_compare_it; + m_parms.no_rsets=no; + m_parms.rsets=xmalloc(sizeof(*m_parms.rsets)*no); + m_parms.rset_term = rset_term_create (term, length, flags, + term_type); + b_parms.key_size = sizeof(struct it_key); + b_parms.cmp = key_compare_it; + b_parms.is = zi->reg->isamb; + /* FIXME - make it so that we can pass a null ptr to term */ + /* needs changes in all rsets, here and there! */ + for (i=0;i