Update of /cvsroot/monetdb/pathfinder/modules/pftijah
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv27125

Modified Files:
      Tag: XQuery_0-16
        pftijah.mx serialize_pftijah.mx 
Log Message:
* pftijah is now able to work with pathfinder collections. When the collection
  parameter "pf_collection" all new documents added to the index are shredded
  into this pathfinder collection.



Index: serialize_pftijah.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/serialize_pftijah.mx,v
retrieving revision 1.36.2.2
retrieving revision 1.36.2.3
diff -u -d -r1.36.2.2 -r1.36.2.3
--- serialize_pftijah.mx        8 Feb 2007 18:15:24 -0000       1.36.2.2
+++ serialize_pftijah.mx        19 Feb 2007 15:27:39 -0000      1.36.2.3
@@ -890,6 +890,7 @@
         if ( (tjPre = tj_add2plane(tjctx, termOid)) == oid_nil )
            return 0;
         if ( tj_pushTag(tjctx,tjPre) < 0 ) return 0;
+        if ( 0 ) stream_printf(GDKout,"C[%s]:startElement: \"%s\", termoid=%d, 
Tijah pre#=%d, Pathfinder pre#=%d\n",tjctx->name,name,termOid,tjPre,pre);
 #ifdef TJ_TRACE
         if ( TJ_TRACE ) stream_printf(GDKout,"C[%s]:startElement: \"%s\", 
termoid=%d, Tijah pre#=%d, Pathfinder 
pre#=%d\n",tjctx->name,name,termOid,tjPre,pre);
 #endif

Index: pftijah.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/pftijah.mx,v
retrieving revision 1.92.2.11
retrieving revision 1.92.2.12
diff -u -d -r1.92.2.11 -r1.92.2.12
--- pftijah.mx  19 Feb 2007 11:52:42 -0000      1.92.2.11
+++ pftijah.mx  19 Feb 2007 15:27:38 -0000      1.92.2.12
@@ -309,6 +309,7 @@
     return collection_lock;
 }
 
+
 ADDHELP("tj_init_collection", "flokstra & rode", "Jan 2007",
 "PARAMETERS:\n\
 - str collName: the name of the collection
@@ -378,12 +379,14 @@
          if ( verbose ) printf("#TJ: 
tj_init_global():param[%s]=\"%s\"\n",$h,$t);
          if ( $h = "stemmer" ) {
              stemmer := $t;
+         } else if ( $h = "pf_collection" ) {
+              bat("tj_" + collName + "_param").insert($h,$t);
          } else if ( $h = "fragmentSize" ) {
               bat("tj_" + collName + "_param").insert($h,$t);
          } else if ( $h = "tagFilter" ) {
               tagfilter := $t;
          } else {
-             ERROR("# tj_init_global() unkonwn parameter [%s].\n",$h);
+             ERROR("# tj_init_collection() unknown parameter [%s].\n",$h);
          }
       }
       #
@@ -578,6 +581,7 @@
            
     var i_start;
     if ( store ) {
+       var pf_collection := tj_get_parameter(collName,"pf_collection");
         if ( isnil(uri_name) ) {
          uri_name := uri_loc;
        } else if ( uri_name = "" ) {
@@ -586,7 +590,11 @@
         var ws := ws_create();
         if (not(bat("doc_name").reverse().exist(uri_name))) {
             var s_start := usec();
-           shred_doc(uri_loc,uri_name);
+           if ( isnil(pf_collection) ) {
+               shred_doc(uri_loc,uri_name);
+           } else {
+               shred_doc(uri_loc,uri_name,pf_collection,0LL);
+           }
             if ( timing ) {
              ms := (usec()-s_start)/1000;
               printf("#C[%s]:add2coll(\"%s\"): shred time = 
%lld.%03llds.\n",collName,uri_name,/(ms,1000),%(ms,1000));
@@ -703,6 +711,18 @@
        }
 }
 
+# set a collection parameter
+PROC tj_get_parameter(str collName, str par) : str
+{
+       var parbat := bat("tj_" + collName + "_param");
+
+       if ( parbat.exist(par) ) {
+           return parbat.find(par);
+       } else {
+           return str(nil);
+       }
+}
+
 PROC tj_dump_collection(str collName) : void
 {
     var coll_lock := tj_get_collection_lock(collName);


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to