Added rpn_facet which does little at this stage.
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 1 Nov 2007 14:56:07 +0000 (14:56 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 1 Nov 2007 14:56:07 +0000 (14:56 +0000)
index/Makefile.am
index/index.h
index/rpnfacet.c [new file with mode: 0644]
index/rpnscan.c
win/makefile

index de88857..a4c84b6 100644 (file)
@@ -1,4 +1,4 @@
-## $Id: Makefile.am,v 1.63 2007-02-07 12:08:54 adam Exp $
+## $Id: Makefile.am,v 1.64 2007-11-01 14:56:07 adam Exp $
 
 aux_libs = \
  ../rset/libidzebra-rset.la \
 
 aux_libs = \
  ../rset/libidzebra-rset.la \
@@ -94,7 +94,7 @@ libidzebra_2_0_la_SOURCES = \
   orddict.c orddict.h \
   rank.h rank1.c ranksimilarity.c rankstatic.c \
   recindex.c  recindex.h recindxp.h reckeys.c reckeys.h recstat.c retrieve.c \
   orddict.c orddict.h \
   rank.h rank1.c ranksimilarity.c rankstatic.c \
   recindex.c  recindex.h recindxp.h reckeys.c reckeys.h recstat.c retrieve.c \
-  rpnscan.c rpnsearch.c sortidx.c symtab.c stream.c \
+  rpnscan.c rpnsearch.c rpnfacet.c sortidx.c symtab.c stream.c \
   update_path.c update_file.c trunc.c untrans.c isam_methods.c \
   zaptterm.c zebraapi.c zinfo.c zinfo.h zsets.c key_block.c key_block.h \
   check_res.c
   update_path.c update_file.c trunc.c untrans.c isam_methods.c \
   zaptterm.c zebraapi.c zinfo.c zinfo.h zsets.c key_block.c key_block.h \
   check_res.c
index 4511e4a..76e1bd4 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: index.h,v 1.205 2007-11-01 14:10:03 adam Exp $
+/* $Id: index.h,v 1.206 2007-11-01 14:56:07 adam Exp $
    Copyright (C) 1995-2007
    Index Data ApS
 
    Copyright (C) 1995-2007
    Index Data ApS
 
@@ -436,6 +436,15 @@ ZEBRA_RES zebra_term_limits_APT(ZebraHandle zh,
                                 const char **term_ref_id_str,
                                 NMEM nmem);
 
                                 const char **term_ref_id_str,
                                 NMEM nmem);
 
+ZEBRA_RES rpn_facet(ZebraHandle zh, ODR stream, NMEM nmem,
+                    struct rset_key_control *kc,
+                    Z_AttributesPlusTerm *zapt,
+                    int *position, int *num_entries, 
+                    ZebraScanEntry **list,
+                    int *is_partial, RSET limit_set,
+                    const char *index_type,
+                    int ord_no, int *ords);
+
 YAZ_END_CDECL
 
 #endif
 YAZ_END_CDECL
 
 #endif
diff --git a/index/rpnfacet.c b/index/rpnfacet.c
new file mode 100644 (file)
index 0000000..49d4ad0
--- /dev/null
@@ -0,0 +1,64 @@
+/* $Id: rpnfacet.c,v 1.1 2007-11-01 14:56:07 adam Exp $
+   Copyright (C) 1995-2007
+   Index Data ApS
+
+This file is part of the Zebra server.
+
+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
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+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 this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+*/
+
+#include <stdio.h>
+#include <assert.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <ctype.h>
+
+#include <yaz/diagbib1.h>
+#include "index.h"
+#include <zebra_xpath.h>
+#include <yaz/wrbuf.h>
+#include <attrfind.h>
+#include <charmap.h>
+#include <rset.h>
+#include <yaz/oid_db.h>
+
+ZEBRA_RES rpn_facet(ZebraHandle zh, ODR stream, NMEM nmem,
+                    struct rset_key_control *kc,
+                    Z_AttributesPlusTerm *zapt,
+                    int *position, int *num_entries, 
+                    ZebraScanEntry **list,
+                    int *is_partial, RSET limit_set,
+                    const char *index_type,
+                    int ord_no, int *ords)
+{
+    /* for each ord .. */
+    /*   check that sort idx exist for ord */
+    /*   sweep through result set and sort_idx at the same time */
+    zebra_setError(zh, YAZ_BIB1_TEMPORARY_SYSTEM_ERROR, 
+                   "facet not implemented");
+                
+    return ZEBRA_FAIL;
+}
+
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+
index b4e9fa8..670a30d 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: rpnscan.c,v 1.18 2007-11-01 14:10:03 adam Exp $
+/* $Id: rpnscan.c,v 1.19 2007-11-01 14:56:07 adam Exp $
    Copyright (C) 1995-2007
    Index Data ApS
 
    Copyright (C) 1995-2007
    Index Data ApS
 
@@ -41,7 +41,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 #define RPN_MAX_ORDS 32
 
 
 #define RPN_MAX_ORDS 32
 
-int log_scan = YLOG_LOG;
+static int log_scan = YLOG_LOG;
 
 /* convert APT SCAN term to internal cmap */
 static ZEBRA_RES trans_scan_term(ZebraHandle zh, Z_AttributesPlusTerm *zapt,
 
 /* convert APT SCAN term to internal cmap */
 static ZEBRA_RES trans_scan_term(ZebraHandle zh, Z_AttributesPlusTerm *zapt,
@@ -280,8 +280,8 @@ static int scan_save_set(ZebraHandle zh, ODR stream, NMEM nmem,
     }
     return 0;
 }
     }
     return 0;
 }
-        
-static ZEBRA_RES rpn_scan_ver2(ZebraHandle zh, ODR stream, NMEM nmem,
+
+static ZEBRA_RES rpn_scan_norm(ZebraHandle zh, ODR stream, NMEM nmem,
                                struct rset_key_control *kc,
                                Z_AttributesPlusTerm *zapt,
                                int *position, int *num_entries, 
                                struct rset_key_control *kc,
                                Z_AttributesPlusTerm *zapt,
                                int *position, int *num_entries, 
@@ -572,9 +572,14 @@ ZEBRA_RES rpn_scan(ZebraHandle zh, ODR stream, Z_AttributesPlusTerm *zapt,
     nmem = nmem_create();
     kc = zebra_key_control_create(zh);
 
     nmem = nmem_create();
     kc = zebra_key_control_create(zh);
 
-    res = rpn_scan_ver2(zh, stream, nmem, kc, zapt, position, num_entries,
+    if (sort_flag)
+        res = rpn_facet(zh, stream, nmem, kc, zapt, position, num_entries,
                         list,
                         is_partial, limit_set, index_type, ord_no, ords);
                         list,
                         is_partial, limit_set, index_type, ord_no, ords);
+    else
+        res = rpn_scan_norm(zh, stream, nmem, kc, zapt, position, num_entries,
+                            list,
+                            is_partial, limit_set, index_type, ord_no, ords);
     nmem_destroy(nmem);
     (*kc->dec)(kc);
     return res;
     nmem_destroy(nmem);
     (*kc->dec)(kc);
     return res;
index 9d033d4..3504020 100644 (file)
@@ -1,5 +1,5 @@
 # Zebra makefile for MS NMAKE
 # Zebra makefile for MS NMAKE
-# $Id: makefile,v 1.66 2007-09-11 15:29:35 adam Exp $
+# $Id: makefile,v 1.67 2007-11-01 14:56:08 adam Exp $
  
 ###########################################################
 ############### Parameters 
  
 ###########################################################
 ############### Parameters 
@@ -400,6 +400,7 @@ ZEBRALIB_OBJS= \
        $(OBJDIR)\regxread.obj \
        $(OBJDIR)\res.obj \
        $(OBJDIR)\retrieve.obj \
        $(OBJDIR)\regxread.obj \
        $(OBJDIR)\res.obj \
        $(OBJDIR)\retrieve.obj \
+       $(OBJDIR)\rpnfacet.obj \
        $(OBJDIR)\rpnscan.obj \
        $(OBJDIR)\rpnsearch.obj \
        $(OBJDIR)\rsbetween.obj \
        $(OBJDIR)\rpnscan.obj \
        $(OBJDIR)\rpnsearch.obj \
        $(OBJDIR)\rsbetween.obj \