Merge branch 'master' into protocol-version2
authorDennis Schafroth <dennis@indexdata.com>
Mon, 23 Apr 2012 10:44:21 +0000 (10:44 +0000)
committerDennis Schafroth <dennis@indexdata.com>
Mon, 23 Apr 2012 10:44:21 +0000 (10:44 +0000)
58 files changed:
buildconf.sh
etc/default.xml
js/pz2.js
src/client.c
src/client.h
src/database.c
src/database.h
src/http_command.c
src/pazpar2_config.c
src/pazpar2_config.h
src/session.c
src/session.h
src/settings.c
src/settings.h
test/Makefile.am
test/run_pazpar2.sh
test/test_http.sh
test/test_limit_limitmap.cfg [new file with mode: 0644]
test/test_limit_limitmap.sh [new file with mode: 0755]
test/test_limit_limitmap.urls [new file with mode: 0644]
test/test_limit_limitmap_1.res [new file with mode: 0644]
test/test_limit_limitmap_10.res [new file with mode: 0644]
test/test_limit_limitmap_11.res [new file with mode: 0644]
test/test_limit_limitmap_12.res [new file with mode: 0644]
test/test_limit_limitmap_13.res [new file with mode: 0644]
test/test_limit_limitmap_14.res [new file with mode: 0644]
test/test_limit_limitmap_15.res [new file with mode: 0644]
test/test_limit_limitmap_16.res [new file with mode: 0644]
test/test_limit_limitmap_17.res [new file with mode: 0644]
test/test_limit_limitmap_18.res [new file with mode: 0644]
test/test_limit_limitmap_19.res [new file with mode: 0644]
test/test_limit_limitmap_2.res [new file with mode: 0644]
test/test_limit_limitmap_20.res [new file with mode: 0644]
test/test_limit_limitmap_21.res [new file with mode: 0644]
test/test_limit_limitmap_22.res [new file with mode: 0644]
test/test_limit_limitmap_23.res [new file with mode: 0644]
test/test_limit_limitmap_24.res [new file with mode: 0644]
test/test_limit_limitmap_25.res [new file with mode: 0644]
test/test_limit_limitmap_26.res [new file with mode: 0644]
test/test_limit_limitmap_27.res [new file with mode: 0644]
test/test_limit_limitmap_28.res [new file with mode: 0644]
test/test_limit_limitmap_29.res [new file with mode: 0644]
test/test_limit_limitmap_3.res [new file with mode: 0644]
test/test_limit_limitmap_30.res [new file with mode: 0644]
test/test_limit_limitmap_31.res [new file with mode: 0644]
test/test_limit_limitmap_4.res [new file with mode: 0644]
test/test_limit_limitmap_4.xml [new file with mode: 0644]
test/test_limit_limitmap_5.res [new file with mode: 0644]
test/test_limit_limitmap_6.res [new file with mode: 0644]
test/test_limit_limitmap_7.res [new file with mode: 0644]
test/test_limit_limitmap_8.res [new file with mode: 0644]
test/test_limit_limitmap_9.res [new file with mode: 0644]
test/test_limit_limitmap_service.xml [new file with mode: 0644]
test/test_limit_limitmap_settings_1.xml [new file with mode: 0644]
test/test_limit_limitmap_settings_2.xml [new file with mode: 0644]
test/test_limit_limitmap_settings_3.xml [new file with mode: 0644]
test/test_limit_limitmap_settings_4.xml [new file with mode: 0644]
test/test_limit_limitmap_settings_5.xml [new file with mode: 0644]

index ac1f580..fdadda8 100755 (executable)
@@ -61,7 +61,7 @@ sh_flags=""
 conf_flags=""
 case $1 in
     -d)
-       sh_cflags="-g -Wall -Wdeclaration-after-statement -Wstrict-prototypes"
+       sh_cflags="-O0 -g -Wall -Wdeclaration-after-statement -Wstrict-prototypes"
        sh_cxxflags="-g -Wall"
        enable_configure=true
        enable_help=false
index 5a9b299..fe6773a 100644 (file)
@@ -33,7 +33,7 @@
   <metadata name="issn"/>
   <metadata name="tech-rep-nr"/>
   <metadata name="author" brief="yes" termlist="yes" merge="unique" 
-           rank="2" mergekey="optional"/>
+           rank="2" mergekey="optional" limitmap="ccl: au" />
   <metadata name="author-title"/>
   <metadata name="author-date"/>
   <metadata name="corporate-name"/>
@@ -51,7 +51,7 @@
   <metadata name="title-dates" brief="yes" merge="longest"/>
   <metadata name="title-medium" brief="yes" merge="longest"/>
   <metadata name="title-number-section" brief="yes" merge="longest"/>
-  <metadata name="medium" brief="yes" merge="longest" mergekey="optional"/>
+  <metadata name="medium" brief="yes" merge="longest" mergekey="optional" limitmap="local:" />
   <metadata name="iii-id" brief="yes" merge="no"/>
   <metadata name="edition"/>
   <metadata name="publication-place"/>
@@ -69,7 +69,7 @@
   
   <metadata name="description" brief="yes" merge="unique" rank="3"/>
   <metadata name="subject-long" rank="3"/>
-  <metadata name="subject" termlist="yes" rank="0"/>
+  <metadata name="subject" termlist="yes" rank="0" limitmap="ccl: su" />
   <metadata name="snippet" brief="yes" merge="unique"/>
   <metadata name="electronic-url" brief="yes" merge="no"/>
   <metadata name="electronic-format-type" />
index 7edf35d..e2335da 100644 (file)
--- a/js/pz2.js
+++ b/js/pz2.js
@@ -126,6 +126,8 @@ var pz2 = function ( paramArray )
     if (this.useSessions && paramArray.autoInit !== false) {
         this.init(this.sessionId, this.serviceId);
     }
+    // Version parameter
+    this.version = paramArray.version || null;
 };
 
 pz2.prototype = 
@@ -382,17 +384,19 @@ pz2.prototype =
         var request = new pzHttpRequest(this.pz2String, this.errorHandler);
        var requestParameters = 
           {
-            "command": "show", 
-            "session": this.sessionID, 
-            "start": this.currentStart,
-            "num": this.currentNum, 
-            "sort": this.currentSort, 
-            "block": 1,
-            "type": this.showResponseType,
-            "windowid" : window.name
+              "command": "show", 
+              "session": this.sessionID, 
+              "start": this.currentStart,
+              "num": this.currentNum, 
+              "sort": this.currentSort, 
+              "block": 1,
+              "type": this.showResponseType,
+              "windowid" : window.name,
           };
         if (query_state)
           requestParameters["query-state"] = query_state;
+       if (this.version && this.version > 0)
+           requestParameters["version"] = this.version;
         request.safeGet(
          requestParameters,
           function(data, type) {
@@ -437,7 +441,14 @@ pz2.prototype =
             } else {
               context.throwError('Show failed. Malformed WS resonse.',
                   114);
-            }
+            };
+           var approxNode = data.getElementsByTagName("approximation");
+           if (approxNode)
+               show['approximation'] = 
+                 Number( approxNode[0].childNodes[0].nodeValue);
+             
+
+             data.getElementsByTagName("")
             context.activeClients = activeClients; 
             context.showCounter++;
             var delay = context.showTime;
@@ -557,7 +568,9 @@ pz2.prototype =
                 "command": "termlist", 
                 "session": this.sessionID, 
                 "name": this.termKeys,
-                "windowid" : window.name
+                "windowid" : window.name, 
+               "version" : this.version
+       
             },
             function(data) {
                 if ( data.getElementsByTagName("termlist") ) {
@@ -587,12 +600,22 @@ pz2.prototype =
                                     .childNodes[0].nodeValue || 'ERROR'
                             };
 
+                           // Only for xtargets: id, records, filtered
                             var termIdNode = 
                                 terms[j].getElementsByTagName("id");
                             if(terms[j].getElementsByTagName("id").length)
                                 term["id"] = 
                                     termIdNode[0].childNodes[0].nodeValue;
                             termList[listName][j] = term;
+
+                           var recordsNode  = terms[j].getElementsByTagName("records");
+                           if (recordsNode && recordsNode.length)
+                               term["records"] = recordsNode[0].childNodes[0].nodeValue;
+                              
+                           var filteredNode  = terms[j].getElementsByTagName("filtered");
+                           if (filteredNode && filteredNode.length)
+                               term["filtered"] = filteredNode[0].childNodes[0].nodeValue;
+                              
                         }
                     }
 
@@ -638,7 +661,8 @@ pz2.prototype =
                "command": "bytarget", 
                "session": this.sessionID, 
                "block": 1,
-               "windowid" : window.name
+               "windowid" : window.name,
+               "version" : this.version
            },
             function(data) {
                 if ( data.getElementsByTagName("status")[0]
index 97b830c..9e52b0a 100644 (file)
@@ -111,6 +111,7 @@ struct client {
     char *addinfo; // diagnostic info for most resent error
     Odr_int hits;
     int record_offset;
+    int filtered; // When using local:, this will count the number of filtered records.
     int maxrecs;
     int startrecs;
     int diagnostic;
@@ -546,11 +547,10 @@ void client_search_response(struct client *cl)
     }
     else
     {
-        yaz_log(YLOG_DEBUG, "client_search_response: hits "
-                ODR_INT_PRINTF, cl->hits);
         client_report_facets(cl, resultset);
         cl->record_offset = cl->startrecs;
         cl->hits = ZOOM_resultset_size(resultset);
+        yaz_log(YLOG_DEBUG, "client_search_response: hits " ODR_INT_PRINTF, cl->hits);
         if (cl->suggestions)
             client_suggestions_destroy(cl);
         cl->suggestions = client_suggestions_create(ZOOM_resultset_option_get(resultset, "suggestions"));
@@ -589,8 +589,7 @@ static void client_record_ingest(struct client *cl)
         else if (ZOOM_record_error(rec, &msg, &addinfo, 0))
         {
             yaz_log(YLOG_WARN, "Record error %s (%s): %s (rec #%d)",
-                    msg, addinfo, client_get_id(cl),
-                    cl->record_offset);
+                    msg, addinfo, client_get_id(cl), cl->record_offset);
         }
         else
         {
@@ -609,8 +608,11 @@ static void client_record_ingest(struct client *cl)
             else
             {
                 /* OK = 0, -1 = failure, -2 = Filtered */
-                if (ingest_record(cl, xmlrec, cl->record_offset, nmem) == -1)
+                int rc = ingest_record(cl, xmlrec, cl->record_offset, nmem);
+                if (rc == -1)
                     yaz_log(YLOG_WARN, "Failed to ingest from %s", client_get_id(cl));
+                if (rc == -2)
+                    cl->filtered += 1;
             }
             nmem_destroy(nmem);
         }
@@ -663,6 +665,7 @@ void client_reingest(struct client *cl)
 {
     int i = cl->startrecs;
     int to = cl->record_offset;
+    cl->filtered = 0;
 
     cl->record_offset = i;
     for (; i < to; i++)
@@ -753,8 +756,14 @@ void client_start_search(struct client *cl)
     const char *opt_sort        = session_setting_oneval(sdb, PZ_SORT);
     const char *opt_preferred   = session_setting_oneval(sdb, PZ_PREFERRED);
     const char *extra_args      = session_setting_oneval(sdb, PZ_EXTRA_ARGS);
-    char maxrecs_str[24], startrecs_str[24];
+    const char *opt_present_chunk = session_setting_oneval(sdb, PZ_PRESENT_CHUNK);
     ZOOM_query q;
+    char maxrecs_str[24], startrecs_str[24], present_chunk_str[24];
+    int present_chunk = 20; // Default chunk size
+    if (opt_present_chunk && strcmp(opt_present_chunk,"")) {
+        present_chunk = atoi(opt_present_chunk);
+        yaz_log(YLOG_DEBUG, "Present chunk set to %d", present_chunk);
+    }
 
     assert(link);
 
@@ -792,11 +801,16 @@ void client_start_search(struct client *cl)
     sprintf(maxrecs_str, "%d", cl->maxrecs);
     ZOOM_connection_option_set(link, "count", maxrecs_str);
 
-    if (cl->maxrecs > 20)
-        ZOOM_connection_option_set(link, "presentChunk", "20");
-    else
+    /* A present_chunk less than 1 will disable chunking. */
+    if (present_chunk > 0 && cl->maxrecs > present_chunk) {
+        sprintf(present_chunk_str, "%d", present_chunk);
+        ZOOM_connection_option_set(link, "presentChunk", present_chunk_str);
+        yaz_log(YLOG_DEBUG, "Present chunk set to %s", present_chunk_str);
+    }
+    else {
         ZOOM_connection_option_set(link, "presentChunk", maxrecs_str);
-
+        yaz_log(YLOG_DEBUG, "Present chunk set to %s (maxrecs)", maxrecs_str);
+    }
     sprintf(startrecs_str, "%d", cl->startrecs);
     ZOOM_connection_option_set(link, "start", startrecs_str);
 
@@ -876,6 +890,7 @@ struct client *client_create(const char *id)
     cl->session = 0;
     cl->hits = 0;
     cl->record_offset = 0;
+    cl->filtered = 0;
     cl->diagnostic = 0;
     cl->state = Client_Disconnected;
     cl->show_raw = 0;
@@ -1313,11 +1328,26 @@ Odr_int client_get_hits(struct client *cl)
     return cl->hits;
 }
 
+Odr_int client_get_approximation(struct client *cl)
+{
+    if (cl->record_offset > 0) {
+        Odr_int approx = ((10 * cl->hits * (cl->record_offset - cl->filtered)) / cl->record_offset + 5) /10;
+        yaz_log(YLOG_LOG, "%s: Approx: %lld * %d / %d = %lld ", client_get_id(cl), cl->hits, cl->record_offset - cl->filtered, cl->record_offset, approx);
+        return approx;
+    }
+    return cl->hits;
+}
+
 int client_get_num_records(struct client *cl)
 {
     return cl->record_offset;
 }
 
+int client_get_num_records_filtered(struct client *cl)
+{
+    return cl->filtered;
+}
+
 void client_set_diagnostic(struct client *cl, int diagnostic,
                            const char *addinfo)
 {
index 7971408..10b3fb4 100644 (file)
@@ -88,7 +88,9 @@ int client_parse_query(struct client *cl, const char *query,
                        facet_limits_t facet_limits, const char *startrecs,
                        const char *maxrecs);
 Odr_int client_get_hits(struct client *cl);
+Odr_int client_get_approximation(struct client *cl);
 int client_get_num_records(struct client *cl);
+int client_get_num_records_filtered(struct client *cl);
 int client_get_diagnostic(struct client *cl, const char **addinfo);
 void client_set_diagnostic(struct client *cl, int diagnostic,
                            const char *addinfo);
index 139950b..21b442c 100644 (file)
@@ -56,21 +56,36 @@ struct database_criterion {
 
 struct database *new_database(const char *id, NMEM nmem)
 {
+    return new_database_inherit_settings(id, nmem, 0);
+}
+struct database *new_database_inherit_settings(const char *id, NMEM nmem, struct settings *service_settings)
+{
     struct database *db;
     struct setting *idset;
 
     db = nmem_malloc(nmem, sizeof(*db));
     db->id = nmem_strdup(nmem, id);
-    db->num_settings = PZ_MAX_EOF;
-    db->settings = nmem_malloc(nmem, sizeof(struct settings*) * 
-                               db->num_settings);
     db->next = 0;
-    memset(db->settings, 0, sizeof(struct settings*) * db->num_settings);
+
+    if (service_settings && service_settings->num_settings > 0) {
+        yaz_log(YLOG_DEBUG, "copying settings from service to database %s settings", db->id);
+        db->num_settings = service_settings->num_settings;
+        db->settings = nmem_malloc(nmem, sizeof(struct settings*) * db->num_settings);
+        // Initialize database settings with service settings
+        memcpy(db->settings, service_settings->settings,  sizeof(struct settings*) * db->num_settings);
+
+    }
+    else {
+        yaz_log(YLOG_DEBUG, "No service settings to database %s ", db->id);
+        db->num_settings = PZ_MAX_EOF;
+        db->settings = nmem_malloc(nmem, sizeof(struct settings*) * db->num_settings);
+        memset(db->settings, 0, sizeof(struct settings*) * db->num_settings);
+    }
     idset = nmem_malloc(nmem, sizeof(*idset));
     idset->precedence = 0;
     idset->name = "pz:id";
     idset->target = idset->value = db->id;
-    idset->next = 0;
+    idset->next = db->settings[PZ_ID];
     db->settings[PZ_ID] = idset;
 
     return db;
@@ -86,8 +101,9 @@ struct database *create_database_for_service(const char *id,
         if (!strcmp(p->id, id))
             return p;
     
-    p = new_database(id, service->nmem);
-    
+    yaz_log(YLOG_DEBUG, "new database %s under service %s values %p", id, service->id);
+    p = new_database_inherit_settings(id, service->nmem, service->settings);
+
     p->next = service->databases;
     service->databases = p;
 
index ae77337..0ed6fa9 100644 (file)
@@ -23,6 +23,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 struct session_database;
 struct session;
 struct conf_service;
+struct settings;
+
 struct database *create_database_for_service(const char *id,
                                             struct conf_service *service);
 int session_grep_databases(struct session *se, const char *filter,
@@ -31,6 +33,8 @@ int predef_grep_databases(void *context, struct conf_service *service,
                          void (*fun)(void *context, struct database *db));
 int match_zurl(const char *zurl, const char *pattern);
 struct database *new_database(const char *id, NMEM nmem);
+// inherit values from (service) settings
+struct database *new_database_inherit_settings(const char *id, NMEM nmem, struct settings *settings);
 
 
 #endif
index e3c0c69..d4b4a77 100644 (file)
@@ -93,6 +93,16 @@ struct http_sessions {
 static YAZ_MUTEX g_http_session_mutex = 0;
 static int g_http_sessions = 0;
 
+int get_version(struct http_request *rq) {
+    const char *version = http_argbyname(rq, "version");
+    int version_no = 0;
+    if (version && strcmp(version, "")) {
+        version_no = atoi(version);
+    }
+    return version_no;
+}
+
+
 int http_session_use(int delta)
 {
     int sessions;
@@ -513,8 +523,9 @@ static void cmd_settings(struct http_channel *c)
 static void termlist_response(struct http_channel *c, struct http_session *s, const char *cmd_status)
 {
     struct http_request *rq = c->request;
-    const char *name = http_argbyname(rq, "name");
-    const char *nums = http_argbyname(rq, "num");
+    const char *name    = http_argbyname(rq, "name");
+    const char *nums    = http_argbyname(rq, "num");
+    int version = get_version(rq);
     int num = 15;
     int status;
 
@@ -530,7 +541,7 @@ static void termlist_response(struct http_channel *c, struct http_session *s, co
     }
     wrbuf_printf(c->wrbuf, "<activeclients>%d</activeclients>\n", status);
 
-    perform_termlist(c, s->psession, name, num);
+    perform_termlist(c, s->psession, name, num, version);
 
     response_close(c, "termlist");
 }
@@ -676,7 +687,7 @@ static void bytarget_response(struct http_channel *c, struct http_session *s, co
     struct hitsbytarget *ht;
     struct http_request *rq = c->request;
     const char *settings = http_argbyname(rq, "settings");
-
+    int version = get_version(rq);
     ht = get_hitsbytarget(s->psession, &count, c->nmem);
     if (!cmd_status)
         /* Old protocol, always ok */
@@ -714,8 +725,11 @@ static void bytarget_response(struct http_channel *c, struct http_session *s, co
             wrbuf_puts(c->wrbuf, "</addinfo>\n");
         }
 
-        wrbuf_printf(c->wrbuf, "<records>%d</records>\n", ht[i].records);
-
+        wrbuf_printf(c->wrbuf, "<records>%d</records>\n", ht[i].records - ht[i].filtered);
+        if (version >= 2) {
+            wrbuf_printf(c->wrbuf, "<filtered>%d</filtered>\n", ht[i].filtered);
+            wrbuf_printf(c->wrbuf, "<approximation>" ODR_INT_PRINTF "</approximation>\n", ht[i].approximation);
+        }
         wrbuf_puts(c->wrbuf, "<state>");
         wrbuf_xmlputs(c->wrbuf, ht[i].state);
         wrbuf_puts(c->wrbuf, "</state>\n");
@@ -1043,10 +1057,13 @@ static void show_records(struct http_channel *c, struct http_session *s, int act
     const char *start = http_argbyname(rq, "start");
     const char *num = http_argbyname(rq, "num");
     const char *sort = http_argbyname(rq, "sort");
+    int version = get_version(rq);
+
     int startn = 0;
     int numn = 20;
     int total;
     Odr_int total_hits;
+    Odr_int approx_hits;
     int i;
 
     if (!s)
@@ -1069,12 +1086,15 @@ static void show_records(struct http_channel *c, struct http_session *s, int act
 
     }
     
-    rl = show_range_start(s->psession, sp, startn, &numn, &total, &total_hits);
+    rl = show_range_start(s->psession, sp, startn, &numn, &total, &total_hits, &approx_hits);
 
     response_open(c, "show");
     wrbuf_printf(c->wrbuf, "\n<activeclients>%d</activeclients>\n", active);
     wrbuf_printf(c->wrbuf, "<merged>%d</merged>\n", total);
     wrbuf_printf(c->wrbuf, "<total>" ODR_INT_PRINTF "</total>\n", total_hits);
+    if (version >= 2) {
+        wrbuf_printf(c->wrbuf, "<approximation>" ODR_INT_PRINTF "</approximation>\n", approx_hits);
+    }
     wrbuf_printf(c->wrbuf, "<start>%d</start>\n", startn);
     wrbuf_printf(c->wrbuf, "<num>%d</num>\n", numn);
 
@@ -1127,6 +1147,7 @@ static void cmd_show(struct http_channel *c)
     const char *block = http_argbyname(rq, "block");
     const char *sort = http_argbyname(rq, "sort");
     const char *block_error = http_argbyname(rq, "report");
+
     struct reclist_sortparms *sp;
     int status;
     int report_error = 0;
index bc5ba6d..ab4382b 100644 (file)
@@ -75,7 +75,8 @@ static void conf_metadata_assign(NMEM nmem,
                                  int rank,
                                  int sortkey_offset,
                                  enum conf_metadata_mergekey mt,
-                                 const char *facetrule)
+                                 const char *facetrule,
+                                 const char *limitmap)
 {
     assert(nmem && metadata && name);
     
@@ -96,6 +97,7 @@ static void conf_metadata_assign(NMEM nmem,
     metadata->sortkey_offset = sortkey_offset;
     metadata->mergekey = mt;
     metadata->facetrule = nmem_strdup_null(nmem, facetrule);
+    metadata->limitmap = nmem_strdup_null(nmem, limitmap);
 }
 
 
@@ -110,13 +112,14 @@ static void conf_sortkey_assign(NMEM nmem,
     sortkey->type = type;
 }
 
-static struct conf_service *service_init(struct conf_server *server,
+struct conf_service *service_init(struct conf_server *server,
                                          int num_metadata, int num_sortkeys,
                                          const char *service_id)
 {
     struct conf_service * service = 0;
     NMEM nmem = nmem_create();
 
+
     service = nmem_malloc(nmem, sizeof(struct conf_service));
     service->mutex = 0;
     service->ref_count = 1;
@@ -132,7 +135,19 @@ static struct conf_service *service_init(struct conf_server *server,
     service->charsets = 0;
 
     service->id = service_id ? nmem_strdup(nmem, service_id) : 0;
+    // Setup a dictionary from server.
+    service->dictionary = 0;
+
+    service->settings = nmem_malloc(nmem, sizeof(struct settings));
+    service->settings->num_settings = PZ_MAX_EOF;
+    service->settings->settings = nmem_malloc(nmem, sizeof(struct setting*) * service->settings->num_settings);
+    memset(service->settings->settings, 0, sizeof(struct setting*) * service->settings->num_settings);
+    //  inherit_server_settings_values(service);
+
+    service->next = 0;
+
     service->num_metadata = num_metadata;
+
     service->metadata = 0;
     if (service->num_metadata)
         service->metadata 
@@ -144,7 +159,8 @@ static struct conf_service *service_init(struct conf_server *server,
         service->sortkeys 
             = nmem_malloc(nmem, 
                           sizeof(struct conf_sortkey) * service->num_sortkeys);
-    service->dictionary = 0;
+
+
     return service; 
 }
 
@@ -160,7 +176,9 @@ static struct conf_metadata* conf_service_add_metadata(
     int rank,
     int sortkey_offset,
     enum conf_metadata_mergekey mt,
-    const char *facetrule)
+    const char *facetrule,
+    const char *limitmap
+    )
 {
     struct conf_metadata * md = 0;
 
@@ -171,7 +189,7 @@ static struct conf_metadata* conf_service_add_metadata(
     md = service->metadata + field_id;
     conf_metadata_assign(service->nmem, md, name, type, merge, setting,
                          brief, termlist, rank, sortkey_offset,
-                         mt, facetrule);
+                         mt, facetrule, limitmap);
     return md;
 }
 
@@ -274,6 +292,7 @@ static int parse_metadata(struct conf_service *service, xmlNode *n,
     xmlChar *xml_rank = 0;
     xmlChar *xml_setting = 0;
     xmlChar *xml_mergekey = 0;
+    xmlChar *xml_limitmap = 0;
     xmlChar *xml_icu_chain = 0;
     struct _xmlAttr *attr;
     for (attr = n->properties; attr; attr = attr->next)
@@ -308,6 +327,9 @@ static int parse_metadata(struct conf_service *service, xmlNode *n,
         else if (!xmlStrcmp(attr->name, BAD_CAST "facetrule") &&
                  attr->children && attr->children->type == XML_TEXT_NODE)
             xml_icu_chain = attr->children->content;
+        else if (!xmlStrcmp(attr->name, BAD_CAST "limitmap") &&
+                 attr->children && attr->children->type == XML_TEXT_NODE)
+            xml_limitmap = attr->children->content;
         else
         {
             yaz_log(YLOG_FATAL, "Unknown metadata attribute '%s'", attr->name);
@@ -448,7 +470,7 @@ static int parse_metadata(struct conf_service *service, xmlNode *n,
                               (const char *) xml_name,
                               type, merge, setting,
                               brief, termlist, rank, sortkey_offset,
-                              mergekey_type, (const char *) xml_icu_chain);
+                              mergekey_type, (const char *) xml_icu_chain, (const char *) xml_limitmap);
     (*md_node)++;
     return 0;
 }
@@ -557,6 +579,15 @@ static struct conf_service *service_create_static(struct conf_server *server,
             if (service_xslt_config(service, n))
                 return 0;
         }
+        else if (!strcmp((const char *) n->name, (const char *) "set"))
+        {
+            xmlChar *name= xmlGetProp(n, (xmlChar *) "name");
+            xmlChar *value = xmlGetProp(n, (xmlChar *) "value");
+            if (service->dictionary && name && value) {
+                yaz_log(YLOG_DEBUG, "service set: %s=%s (Not implemented)", (char *) name, (char *) value);
+                //service_aply_setting(service, name, value);
+            }
+        }
         else
         {
             yaz_log(YLOG_FATAL, "Bad element: %s", n->name);
@@ -610,8 +641,7 @@ static void inherit_server_settings(struct conf_service *s)
         }
         else
         {
-            yaz_log(YLOG_WARN, "service '%s' has no settings",
-                    s->id ? s->id : "unnamed");
+            yaz_log(YLOG_WARN, "server '%s' has no settings", s->id ? s->id : "unnamed");
             init_settings(s);
         }
     }
@@ -635,8 +665,7 @@ static void inherit_server_settings(struct conf_service *s)
 struct conf_service *service_create(struct conf_server *server,
                                     xmlNode *node)
 {
-    struct conf_service *service = service_create_static(server,
-                                                         node, 0);
+    struct conf_service *service = service_create_static(server, node, 0);
     if (service)
     {
         inherit_server_settings(service);
index 9369b86..58eb0e7 100644 (file)
@@ -83,6 +83,9 @@ struct conf_metadata
     enum conf_setting_type setting; // Value is to be taken from session/db settings?
     enum conf_metadata_mergekey mergekey;
     char *facetrule;
+
+    char *limitmap;  // Should be expanded into service-wide default e.g. pz:limitmap:<name>=value setting
+    char *facetmap;  // Should be expanded into service-wide default e.g. pz:facetmap:<name>=value setting
 };
 
 
@@ -108,6 +111,7 @@ struct conf_service
     int num_sortkeys;
     struct conf_sortkey *sortkeys;
     struct setting_dictionary *dictionary;
+    struct settings *settings;
     struct conf_service *next;
     char *id;
     NMEM nmem;
index 60f3813..54b82da 100644 (file)
@@ -76,6 +76,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #include "settings.h"
 #include "normalize7bit.h"
 
+#include <libxml/tree.h>
+
 #define TERMLIST_HIGH_SCORE 25
 
 #define MAX_CHUNK 15
@@ -819,8 +821,7 @@ void session_init_databases(struct session *se)
 static struct session_database *load_session_database(struct session *se, 
                                                       char *id)
 {
-    struct database *db = new_database(id, se->session_nmem);
-
+    struct database *db = new_database_inherit_settings(id, se->session_nmem, se->service->settings);
     session_init_databases_fun((void*) se, db);
 
     // New sdb is head of se->databases list
@@ -961,7 +962,9 @@ static struct hitsbytarget *hitsbytarget_nb(struct session *se,
         res[*count].id = client_get_id(cl);
         res[*count].name = *name ? name : "Unknown";
         res[*count].hits = client_get_hits(cl);
+        res[*count].approximation = client_get_approximation(cl);
         res[*count].records = client_get_num_records(cl);
+        res[*count].filtered = client_get_num_records_filtered(cl);
         res[*count].diagnostic =
             client_get_diagnostic(cl, &res[*count].addinfo);
         res[*count].state = client_get_state_str(cl);
@@ -1011,14 +1014,25 @@ static int cmp_ht(const void *p1, const void *p2)
     return h2->hits - h1->hits;
 }
 
+// Compares two hitsbytarget nodes by hitcount
+static int cmp_ht_approx(const void *p1, const void *p2)
+{
+    const struct hitsbytarget *h1 = p1;
+    const struct hitsbytarget *h2 = p2;
+    return h2->approximation - h1->approximation;
+}
+
 static int targets_termlist_nb(WRBUF wrbuf, struct session *se, int num,
-                               NMEM nmem)
+                               NMEM nmem, int version)
 {
     struct hitsbytarget *ht;
     int count, i;
 
     ht = hitsbytarget_nb(se, &count, nmem);
-    qsort(ht, count, sizeof(struct hitsbytarget), cmp_ht);
+    if (version >= 2)
+        qsort(ht, count, sizeof(struct hitsbytarget), cmp_ht_approx);
+    else
+        qsort(ht, count, sizeof(struct hitsbytarget), cmp_ht);
     for (i = 0; i < count && i < num && ht[i].hits > 0; i++)
     {
 
@@ -1039,7 +1053,14 @@ static int targets_termlist_nb(WRBUF wrbuf, struct session *se, int num,
         
         wrbuf_printf(wrbuf, "<frequency>" ODR_INT_PRINTF "</frequency>\n",
                      ht[i].hits);
-        
+
+        if (version >= 2) {
+            // Should not print if we know it isn't a approximation.
+            wrbuf_printf(wrbuf, "<approximation>" ODR_INT_PRINTF "</approximation>\n", ht[i].approximation);
+            wrbuf_printf(wrbuf, "<records>%d</records>\n", ht[i].records - ht[i].filtered);
+            wrbuf_printf(wrbuf, "<filtered>%d</filtered>\n", ht[i].filtered);
+        }
+
         wrbuf_puts(wrbuf, "<state>");
         wrbuf_xmlputs(wrbuf, ht[i].state);
         wrbuf_puts(wrbuf, "</state>\n");
@@ -1052,7 +1073,7 @@ static int targets_termlist_nb(WRBUF wrbuf, struct session *se, int num,
 }
 
 void perform_termlist(struct http_channel *c, struct session *se,
-                      const char *name, int num)
+                      const char *name, int num, int version)
 {
     int i, j;
     NMEM nmem_tmp = nmem_create();
@@ -1115,7 +1136,7 @@ void perform_termlist(struct http_channel *c, struct session *se,
             wrbuf_xmlputs(c->wrbuf, tname);
             wrbuf_puts(c->wrbuf, "\">\n");
 
-            targets_termlist_nb(c->wrbuf, se, num, c->nmem);
+            targets_termlist_nb(c->wrbuf, se, num, c->nmem, version);
             wrbuf_puts(c->wrbuf, "</list>\n");
             must_generate_empty = 0;
         }
@@ -1178,7 +1199,7 @@ void show_single_stop(struct session *se, struct record_cluster *rec)
 
 struct record_cluster **show_range_start(struct session *se,
                                          struct reclist_sortparms *sp, 
-                                         int start, int *num, int *total, Odr_int *sumhits)
+                                         int start, int *num, int *total, Odr_int *sumhits, Odr_int *approx_hits)
 {
     struct record_cluster **recs;
     struct reclist_sortparms *spp;
@@ -1192,7 +1213,8 @@ struct record_cluster **show_range_start(struct session *se,
     {
         *num = 0;
         *total = 0;
-        *sumhits = 0;
+        *sumhits = 0;        
+        *approx_hits = 0;
         recs = 0;
     }
     else
@@ -1211,9 +1233,11 @@ struct record_cluster **show_range_start(struct session *se,
         *total = reclist_get_num_records(se->reclist);
 
         *sumhits = 0;
-        for (l = se->clients_active; l; l = l->next)
+        *approx_hits = 0;
+        for (l = se->clients_active; l; l = l->next) {
             *sumhits += client_get_hits(l->client);
-        
+            *approx_hits += client_get_approximation(l->client);
+        }
         for (i = 0; i < start; i++)
             if (!reclist_read_record(se->reclist))
             {
@@ -1541,8 +1565,7 @@ int ingest_record(struct client *cl, const char *rec,
     
     if (!check_record_filter(root, sdb))
     {
-        session_log(se, YLOG_LOG, "Filtered out record no %d from %s",
-                    record_no, sdb->database->id);
+        session_log(se, YLOG_LOG, "Filtered out record no %d from %s", record_no, sdb->database->id);
         xmlFreeDoc(xdoc);
         return -2;
     }
@@ -1563,6 +1586,7 @@ int ingest_record(struct client *cl, const char *rec,
     return ret;
 }
 
+// Skip record on non-zero
 static int check_limit_local(struct client *cl,
                              struct record *record,
                              int record_no)
@@ -1581,9 +1605,7 @@ static int check_limit_local(struct client *cl,
         char **values = 0;
         int i, num_v = 0;
         
-        const char *name =
-            client_get_facet_limit_local(cl, sdb, &l, nmem_tmp, &num_v,
-                                         &values);
+        const char *name = client_get_facet_limit_local(cl, sdb, &l, nmem_tmp, &num_v, &values);
         if (!name)
             break;
         
@@ -1610,10 +1632,10 @@ static int check_limit_local(struct client *cl,
                 }
                 else
                 {
-                    yaz_log(YLOG_LOG, "cmp: '%s' '%s'",
-                            rec_md->data.text.disp, values[i]);
+                    yaz_log(YLOG_LOG, "cmp: '%s' '%s'", rec_md->data.text.disp, values[i]);
                     if (!strcmp(rec_md->data.text.disp, values[i]))
                     {
+                        // Value equals, should not be filtered.
                         break;
                     }
                 }
@@ -1625,6 +1647,7 @@ static int check_limit_local(struct client *cl,
                 i++;
             }
         }
+        // At end , not match
         if (i == num_v)
         {
             skip_record = 1;
index a74c7cc..886f1b6 100644 (file)
@@ -138,9 +138,11 @@ struct hitsbytarget {
     const char *id;
     const char *name;
     Odr_int hits;
+    Odr_int approximation;
     int diagnostic;
     const char *addinfo;
     int records;
+    int filtered;
     const char *state;
     int connected;
     char *settings_xml;
@@ -165,7 +167,7 @@ enum pazpar2_error_code session_search(struct session *s, const char *query,
 struct record_cluster **show_range_start(struct session *s,
                                          struct reclist_sortparms *sp,
                                          int start,
-                                         int *num, int *total, Odr_int *sumhits);
+                                         int *num, int *total, Odr_int *sumhits, Odr_int *approximation);
 void show_range_stop(struct session *s, struct record_cluster **recs);
 
 struct record_cluster *show_single_start(struct session *s, const char *id,
@@ -185,8 +187,7 @@ void session_alert_watch(struct session *s, int what);
 void add_facet(struct session *s, const char *type, const char *value, int count);
 
 
-void perform_termlist(struct http_channel *c, struct session *se,
-                      const char *name, int num);
+void perform_termlist(struct http_channel *c, struct session *se, const char *name, int num, int version);
 void session_log(struct session *s, int level, const char *fmt, ...)
 #ifdef __GNUC__
     __attribute__ ((format (printf, 3, 4)))
index 1f9246c..124d9db 100644 (file)
@@ -71,6 +71,7 @@ static char *hard_settings[] = {
     "pz:max_connections",
     "pz:reuse_connections",
     "pz:termlist_term_factor",
+    "pz:termlist_term_count",
     "pz:preferred",
     "pz:extra_args",
     "pz:query_syntax",
@@ -78,6 +79,8 @@ static char *hard_settings[] = {
     "pz:limitmap:",
     "pz:url",
     "pz:sortmap:",
+    "pz:present_chunk",
+    "pz:block_timeout",
     0
 };
 
@@ -99,13 +102,12 @@ int settings_num(struct conf_service *service)
     return service->dictionary->num;
 }
 
-static int settings_lookup(struct conf_service *service, const char *name,
-                           int allow_create)
+/* Find and possible create a new dictionary entry. Pass valid NMEM pointer if creation is allowed, otherwise null */
+static int settings_index_lookup(struct setting_dictionary *dictionary, const char *name, NMEM nmem)
 {
     size_t maxlen;
     int i;
     const char *p;
-    struct setting_dictionary *dictionary = service->dictionary;
     
     assert(name);
 
@@ -116,31 +118,31 @@ static int settings_lookup(struct conf_service *service, const char *name,
     for (i = 0; i < dictionary->num; i++)
         if (!strncmp(name, dictionary->dict[i], maxlen))
             return i;
-    if (!allow_create)
+    if (!nmem)
         return -1;
     if (!strncmp("pz:", name, 3))
         yaz_log(YLOG_WARN, "Adding pz-type setting name %s", name);
     if (dictionary->num + 1 > dictionary->size)
     {
         char **tmp =
-            nmem_malloc(service->nmem, dictionary->size * 2 * sizeof(char*));
+            nmem_malloc(nmem, dictionary->size * 2 * sizeof(char*));
         memcpy(tmp, dictionary->dict, dictionary->size * sizeof(char*));
         dictionary->dict = tmp;
         dictionary->size *= 2;
     }
-    dictionary->dict[dictionary->num] = nmem_strdup(service->nmem, name);
+    dictionary->dict[dictionary->num] = nmem_strdup(nmem, name);
     dictionary->dict[dictionary->num][maxlen-1] = '\0';
     return dictionary->num++;
 }
 
 int settings_create_offset(struct conf_service *service, const char *name)
 {
-    return settings_lookup(service, name, 1);
+    return settings_index_lookup(service->dictionary, name, service->nmem);
 }
 
 int settings_lookup_offset(struct conf_service *service, const char *name)
 {
-    return settings_lookup(service, name, 0);
+    return settings_index_lookup(service->dictionary, name, 0);
 }
 
 char *settings_name(struct conf_service *service, int offset)
@@ -149,6 +151,22 @@ char *settings_name(struct conf_service *service, int offset)
     return service->dictionary->dict[offset];
 }
 
+
+// Apply a session override to a database
+void service_apply_setting(struct conf_service *service, char *setting, char *value)
+{
+    struct setting *new = nmem_malloc(service->nmem, sizeof(*new));
+    int offset = settings_create_offset(service, setting);
+    expand_settings_array(&service->settings->settings, &service->settings->num_settings, offset, service->nmem);
+    new->precedence = 0;
+    new->target = NULL;
+    new->name = setting;
+    new->value = value;
+    new->next = service->settings->settings[offset];
+    service->settings->settings[offset] = new;
+}
+
+
 static int isdir(const char *path)
 {
     struct stat st;
@@ -333,6 +351,72 @@ void expand_settings_array(struct setting ***set_ar, int *num, int offset,
     }
 }
 
+void expand_settings_array2(struct settings *settings, int offset, NMEM nmem)
+{
+    assert(offset >= 0);
+    assert(settings);
+    if (offset >= settings->num_settings)
+    {
+        int i, n_num = offset + 10;
+        struct setting **n_ar = nmem_malloc(nmem, n_num * sizeof(*n_ar));
+        for (i = 0; i < settings->num_settings; i++)
+            n_ar[i] = settings->settings[i];
+        for (; i < n_num; i++)
+            n_ar[i] = 0;
+        settings->num_settings = n_num;
+        settings->settings = n_ar;
+    }
+}
+
+static void update_settings(struct setting *set, struct settings *settings, int offset, NMEM nmem)
+{
+    struct setting **sp;
+    yaz_log(YLOG_LOG, "update service settings offset %d with %s=%s", offset, set->name, set->value);
+    expand_settings_array2(settings, offset, nmem);
+
+    // First we determine if this setting is overriding any existing settings
+    // with the same name.
+    assert(offset < settings->num_settings);
+    for (sp = &settings->settings[offset]; *sp; )
+        if (!strcmp((*sp)->name, set->name))
+        {
+            if ((*sp)->precedence < set->precedence)
+            {
+                // We discard the value (nmem keeps track of the space)
+                *sp = (*sp)->next; // unlink value from existing setting
+            }
+            else if ((*sp)->precedence > set->precedence)
+            {
+                // Db contains a higher-priority setting. Abort search
+                break;
+            }
+            else if (zurl_wildcard((*sp)->target) > zurl_wildcard(set->target))
+            {
+                // target-specific value trumps wildcard. Delete.
+                *sp = (*sp)->next; // unlink.....
+            }
+            else if (zurl_wildcard((*sp)->target) < zurl_wildcard(set->target))
+                // Db already contains higher-priority setting. Abort search
+                break;
+            else
+                sp = &(*sp)->next;
+        }
+        else
+            sp = &(*sp)->next;
+    if (!*sp) // is null when there are no higher-priority settings, so we add one
+    {
+        struct setting *new = nmem_malloc(nmem, sizeof(*new));
+        memset(new, 0, sizeof(*new));
+        new->precedence = set->precedence;
+        new->target = nmem_strdup_null(nmem, set->target);
+        new->name = nmem_strdup_null(nmem, set->name);
+        new->value = nmem_strdup_null(nmem, set->value);
+        new->next = settings->settings[offset];
+        settings->settings[offset] = new;
+    }
+}
+
+
 // This is called from grep_databases -- adds/overrides setting for a target
 // This is also where the rules for precedence of settings are implemented
 static void update_database_fun(void *context, struct database *db)
@@ -349,8 +433,7 @@ static void update_database_fun(void *context, struct database *db)
         return;
 
     offset = settings_create_offset(service, set->name);
-    expand_settings_array(&db->settings, &db->num_settings, offset,
-                          service->nmem);
+    expand_settings_array(&db->settings, &db->num_settings, offset, service->nmem);
 
     // First we determine if this setting is overriding  any existing settings
     // with the same name.
@@ -419,18 +502,39 @@ static void initialize_hard_settings(struct conf_service *service)
 
 // Read any settings names introduced in service definition (config) and add to dictionary
 // This is done now to avoid errors if user settings are declared in session overrides
-static void initialize_soft_settings(struct conf_service *service)
+void initialize_soft_settings(struct conf_service *service)
 {
     int i;
-
     for (i = 0; i < service->num_metadata; i++)
     {
         struct conf_metadata *md = &service->metadata[i];
 
-        if (md->setting == Metadata_setting_no)
-            continue;
-
-        settings_create_offset(service, md->name);
+        if (md->setting != Metadata_setting_no)
+            settings_create_offset(service, md->name);
+
+        // Also create setting for some metadata attributes.
+        if (md->limitmap) {
+            int index; 
+            WRBUF wrbuf = wrbuf_alloc();
+            yaz_log(YLOG_DEBUG, "Metadata %s has limitmap: %s ",md->name,  md->limitmap);
+            wrbuf_printf(wrbuf, "pz:limitmap:%s", md->name);
+            index = settings_create_offset(service, wrbuf_cstr(wrbuf));
+            if (index >= 0) {
+                struct setting new;
+                int offset;
+                yaz_log(YLOG_DEBUG, "Service %s default %s=%s",
+                        (service->id ? service->id: "unknown"), wrbuf_cstr(wrbuf), md->limitmap);
+                new.name = (char *) wrbuf_cstr(wrbuf);
+                new.value = md->limitmap;
+                new.next = 0;
+                new.target = 0;
+                new.precedence = 0;
+                offset = settings_create_offset(service, new.name);
+                update_settings(&new, service->settings, offset, service->nmem);
+            }
+            wrbuf_destroy(wrbuf);
+        // TODO same for facetmap
+        }
     }
 }
 
index cbba02c..5826ac6 100644 (file)
@@ -44,14 +44,17 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #define PZ_MAX_CONNECTIONS      21
 #define PZ_REUSE_CONNECTIONS    22
 #define PZ_TERMLIST_TERM_FACTOR 23
-#define PZ_PREFERRED            24
-#define PZ_EXTRA_ARGS           25
-#define PZ_QUERY_SYNTAX         26
-#define PZ_FACETMAP             27
-#define PZ_LIMITMAP             28
-#define PZ_URL                  29
-#define PZ_SORTMAP              30
-#define PZ_MAX_EOF              31
+#define PZ_TERMLIST_TERM_COUNT  24
+#define PZ_PREFERRED            25
+#define PZ_EXTRA_ARGS           26
+#define PZ_QUERY_SYNTAX         27
+#define PZ_FACETMAP             28
+#define PZ_LIMITMAP             29
+#define PZ_URL                  30
+#define PZ_SORTMAP              31
+#define PZ_PRESENT_CHUNK        32
+#define PZ_BLOCK_TIMEOUT        33
+#define PZ_MAX_EOF              34
 
 struct setting
 {
@@ -62,6 +65,13 @@ struct setting
     struct setting *next;
 };
 
+struct settings
+{
+    // Array of pointer setting, index is looked up in setting_dictionary
+    struct setting **settings;
+    int num_settings;
+};
+
 void settings_read_file(struct conf_service *service, const char *path,
                         int pass);
 void settings_read_node(struct conf_service *service, xmlNode *n,
index 89c17dd..1c7061b 100644 (file)
@@ -1,7 +1,8 @@
 # This file is part of Pazpar2.
 check_SCRIPTS = test_http.sh test_icu.sh test_post.sh \
  test_settings.sh test_turbomarcxml.sh test_facets.sh \
- test_solr.sh test_url.sh test_filter.sh test_termlist_block.sh
+ test_solr.sh test_url.sh test_filter.sh \
+ test_termlist_block.sh test_limit_limitmap.sh
 
 EXTRA_DIST = run_pazpar2.sh marc21_test.xsl tmarc.xsl solr-pz2.xsl \
        z3950_indexdata_com_marc.xml \
@@ -16,6 +17,11 @@ EXTRA_DIST = run_pazpar2.sh marc21_test.xsl tmarc.xsl solr-pz2.xsl \
        test_url.cfg test_url.urls \
        test_filter.cfg test_filter.urls \
        test_termlist_block.cfg test_termlist_block.urls \
+       test_limit_limitmap.cfg test_limit_limitmap.urls \
+       test_limit_limitmap_service_1.xml test_limit_limitmap_service_2.xml \
+       test_limit_limitmap_setting_1.xml test_limit_limitmap_setting_2.xml \
+       test_limit_limitmap_setting_3.xml test_limit_limitmap_setting_4.xml \
+       test_limit_limitmap_setting_5.xml \
        $(check_SCRIPTS)
 
 TESTS = $(check_SCRIPTS)
index dd56ded..cb6a9b3 100755 (executable)
@@ -152,6 +152,9 @@ if [ -z "$SKIP_PAZPAR2" ] ; then
     sleep 2
 fi
 
+# clean out empty diff files
+find . -name "$TEST*.dif" -empty -delete 
+
 exit $code
 
 # Local Variables:
index 712d5c7..3413346 100755 (executable)
@@ -1,11 +1,13 @@
-#!/bin/sh
+#!/bin/bash
 #
 
+FILE=`basename $0`
+TEST=${FILE/.sh/}
 # srcdir might be set by make
 srcdir=${srcdir:-"."}
 
 # Test using test_http.cfg
-exec ${srcdir}/run_pazpar2.sh test_http
+exec ${srcdir}/run_pazpar2.sh $TEST
 
 # Local Variables:
 # mode:shell-script
diff --git a/test/test_limit_limitmap.cfg b/test/test_limit_limitmap.cfg
new file mode 100644 (file)
index 0000000..9b12a05
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pazpar2 xmlns="http://www.indexdata.com/pazpar2/1.0">
+  <!-- Used by test_preferred.sh -->
+  <server>
+    <listen port="9763"/>
+    <proxy host="localhost"/>
+  </server>
+  
+</pazpar2>
+<!-- Keep this comment at the end of the file
+     Local variables:
+     mode: nxml
+     End:
+-->
diff --git a/test/test_limit_limitmap.sh b/test/test_limit_limitmap.sh
new file mode 100755 (executable)
index 0000000..3413346
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+#
+
+FILE=`basename $0`
+TEST=${FILE/.sh/}
+# srcdir might be set by make
+srcdir=${srcdir:-"."}
+
+# Test using test_http.cfg
+exec ${srcdir}/run_pazpar2.sh $TEST
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation: 2
+# sh-basic-offset: 4
+# End:
diff --git a/test/test_limit_limitmap.urls b/test/test_limit_limitmap.urls
new file mode 100644 (file)
index 0000000..a986e6b
--- /dev/null
@@ -0,0 +1,26 @@
+test_limit_limitmap_service.xml http://localhost:9763/search.pz2?command=init&service=limitmap
+test_limit_limitmap_settings_1.xml http://localhost:9763/search.pz2?session=1&command=settings
+http://localhost:9763/search.pz2?session=1&command=search&query=computer
+4 http://localhost:9763/search.pz2?session=1&command=show&block=1
+http://localhost:9763/search.pz2?session=1&command=bytarget
+http://localhost:9763/search.pz2?session=1&command=termlist&block=1&name=xtargets%2Cauthor%2Csubject%2Cdate
+test_limit_limitmap_settings_2.xml http://localhost:9763/search.pz2?session=1&command=settings
+http://localhost:9763/search.pz2?session=1&command=search&query=computer
+4 http://localhost:9763/search.pz2?session=1&command=show&block=1
+http://localhost:9763/search.pz2?session=1&command=bytarget
+http://localhost:9763/search.pz2?session=1&command=termlist&block=1&name=xtargets%2Cauthor%2Csubject%2Cdate
+http://localhost:9763/search.pz2?session=1&command=termlist&block=1&report=status&name=xtargets%2Cauthor%2Csubject%2Cdate
+http://localhost:9763/search.pz2?session=1&command=bytarget&report=status
+1 http://localhost:9763/search.pz2?session=1&command=search&query=greece&limit=author%3Dadam\,+james%7Cother_author
+1 http://localhost:9763/search.pz2?session=1&command=show&block=1
+test_limit_limitmap_settings_3.xml http://localhost:9763/search.pz2?session=1&command=settings
+1 http://localhost:9763/search.pz2?session=1&command=search&query=greece&limit=author%3Dadam\,+james%7Cother_author
+1 http://localhost:9763/search.pz2?session=1&command=show&block=1
+http://localhost:9763/search.pz2?session=1&command=search&query=greece&limit=author%3Dadam\,+james%7Cother_author&filter=pz%3Aid%3DTarget-1
+http://localhost:9763/search.pz2?session=1&command=bytarget
+http://localhost:9763/search.pz2?session=1&command=show
+test_limit_limitmap_settings_4.xml http://localhost:9763/search.pz2?session=1&command=settings
+http://localhost:9763/search.pz2?session=1&command=search&query=computer&limit=Mysubject%3DRailroads
+http://localhost:9763/search.pz2?session=1&command=show&block=1
+http://localhost:9763/search.pz2?session=1&command=search&query=computer&limit=date%3D1977
+http://localhost:9763/search.pz2?session=1&command=show&block=1
\ No newline at end of file
diff --git a/test/test_limit_limitmap_1.res b/test/test_limit_limitmap_1.res
new file mode 100644 (file)
index 0000000..81ff9ff
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<init><status>OK</status><session>1</session><protocol>1</protocol></init>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_10.res b/test/test_limit_limitmap_10.res
new file mode 100644 (file)
index 0000000..44ad1fb
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bytarget><status>OK</status>
+<target><id>Target-1</id>
+<name>ztest-db1</name>
+<hits>10</hits>
+<diagnostic>0</diagnostic>
+<records>10</records>
+<state>Client_Idle</state>
+</target>
+<target><id>Target-2</id>
+<name>LOC-SOLR</name>
+<hits>2015</hits>
+<diagnostic>0</diagnostic>
+<records>100</records>
+<state>Client_Idle</state>
+</target></bytarget>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_11.res b/test/test_limit_limitmap_11.res
new file mode 100644 (file)
index 0000000..94fb9e9
--- /dev/null
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<termlist><activeclients>0</activeclients>
+<list name="xtargets">
+<term>
+<id>Target-2</id>
+<name>LOC-SOLR</name>
+<frequency>2015</frequency>
+<state>Client_Idle</state>
+<diagnostic>0</diagnostic>
+</term>
+<term>
+<id>Target-1</id>
+<name>ztest-db1</name>
+<frequency>10</frequency>
+<state>Client_Idle</state>
+<diagnostic>0</diagnostic>
+</term>
+</list>
+<list name="author">
+<term><name>Davis, Phyllis</name><frequency>2</frequency></term>
+<term><name>Jack Collins</name><frequency>2</frequency></term>
+<term><name>Langer, Maria</name><frequency>2</frequency></term>
+<term><name>Norton, Peter</name><frequency>2</frequency></term>
+<term><name>Watt, Alan H</name><frequency>2</frequency></term>
+<term><name>Aldrich, Richard W</name><frequency>1</frequency></term>
+<term><name>Appleman, Daniel</name><frequency>1</frequency></term>
+<term><name>Bainbridge, David I</name><frequency>1</frequency></term>
+<term><name>Caplin, Steve</name><frequency>1</frequency></term>
+<term><name>Cole, Eric</name><frequency>1</frequency></term>
+<term><name>De Jong, Kenneth A</name><frequency>1</frequency></term>
+<term><name>Dowd, Kevin</name><frequency>1</frequency></term>
+<term><name>Hodges, M. Susan</name><frequency>1</frequency></term>
+<term><name>Kaasgaard, Klaus</name><frequency>1</frequency></term>
+<term><name>Lasser, Jon</name><frequency>1</frequency></term>
+</list>
+<list name="subject">
+<term><name>Computers</name><frequency>22</frequency></term>
+<term><name>Computer file</name><frequency>20</frequency></term>
+<term><name>Computer networks</name><frequency>15</frequency></term>
+<term><name>Computer science</name><frequency>11</frequency></term>
+<term><name>Computer graphics</name><frequency>10</frequency></term>
+<term><name>Computer program language</name><frequency>10</frequency></term>
+<term><name>Computer security</name><frequency>10</frequency></term>
+<term><name>Computer crimes</name><frequency>7</frequency></term>
+<term><name>Computer software</name><frequency>7</frequency></term>
+<term><name>Microsoft Windows</name><frequency>7</frequency></term>
+<term><name>Computer</name><frequency>6</frequency></term>
+<term><name>Operating systems</name><frequency>6</frequency></term>
+<term><name>Computer programs</name><frequency>5</frequency></term>
+<term><name>Computer systems</name><frequency>5</frequency></term>
+<term><name>UNIX</name><frequency>5</frequency></term>
+</list>
+<list name="date">
+<term><name>2000</name><frequency>48</frequency></term>
+<term><name>1999</name><frequency>20</frequency></term>
+<term><name>2001</name><frequency>14</frequency></term>
+<term><name>1998</name><frequency>11</frequency></term>
+<term><name>1977</name><frequency>3</frequency></term>
+<term><name>1971</name><frequency>2</frequency></term>
+<term><name>1974</name><frequency>2</frequency></term>
+<term><name>1997</name><frequency>2</frequency></term>
+<term><name>1973</name><frequency>1</frequency></term>
+<term><name>1980</name><frequency>1</frequency></term>
+<term><name>1992</name><frequency>1</frequency></term>
+<term><name>1994</name><frequency>1</frequency></term>
+<term><name>1995</name><frequency>1</frequency></term>
+<term><name>1996</name><frequency>1</frequency></term>
+<term><name>2002</name><frequency>1</frequency></term>
+</list>
+</termlist>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_12.res b/test/test_limit_limitmap_12.res
new file mode 100644 (file)
index 0000000..4bbf745
--- /dev/null
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<termlist><status>OK</status>
+<activeclients>0</activeclients>
+<list name="xtargets">
+<term>
+<id>Target-2</id>
+<name>LOC-SOLR</name>
+<frequency>2015</frequency>
+<state>Client_Idle</state>
+<diagnostic>0</diagnostic>
+</term>
+<term>
+<id>Target-1</id>
+<name>ztest-db1</name>
+<frequency>10</frequency>
+<state>Client_Idle</state>
+<diagnostic>0</diagnostic>
+</term>
+</list>
+<list name="author">
+<term><name>Davis, Phyllis</name><frequency>2</frequency></term>
+<term><name>Jack Collins</name><frequency>2</frequency></term>
+<term><name>Langer, Maria</name><frequency>2</frequency></term>
+<term><name>Norton, Peter</name><frequency>2</frequency></term>
+<term><name>Watt, Alan H</name><frequency>2</frequency></term>
+<term><name>Aldrich, Richard W</name><frequency>1</frequency></term>
+<term><name>Appleman, Daniel</name><frequency>1</frequency></term>
+<term><name>Bainbridge, David I</name><frequency>1</frequency></term>
+<term><name>Caplin, Steve</name><frequency>1</frequency></term>
+<term><name>Cole, Eric</name><frequency>1</frequency></term>
+<term><name>De Jong, Kenneth A</name><frequency>1</frequency></term>
+<term><name>Dowd, Kevin</name><frequency>1</frequency></term>
+<term><name>Hodges, M. Susan</name><frequency>1</frequency></term>
+<term><name>Kaasgaard, Klaus</name><frequency>1</frequency></term>
+<term><name>Lasser, Jon</name><frequency>1</frequency></term>
+</list>
+<list name="subject">
+<term><name>Computers</name><frequency>22</frequency></term>
+<term><name>Computer file</name><frequency>20</frequency></term>
+<term><name>Computer networks</name><frequency>15</frequency></term>
+<term><name>Computer science</name><frequency>11</frequency></term>
+<term><name>Computer graphics</name><frequency>10</frequency></term>
+<term><name>Computer program language</name><frequency>10</frequency></term>
+<term><name>Computer security</name><frequency>10</frequency></term>
+<term><name>Computer crimes</name><frequency>7</frequency></term>
+<term><name>Computer software</name><frequency>7</frequency></term>
+<term><name>Microsoft Windows</name><frequency>7</frequency></term>
+<term><name>Computer</name><frequency>6</frequency></term>
+<term><name>Operating systems</name><frequency>6</frequency></term>
+<term><name>Computer programs</name><frequency>5</frequency></term>
+<term><name>Computer systems</name><frequency>5</frequency></term>
+<term><name>UNIX</name><frequency>5</frequency></term>
+</list>
+<list name="date">
+<term><name>2000</name><frequency>48</frequency></term>
+<term><name>1999</name><frequency>20</frequency></term>
+<term><name>2001</name><frequency>14</frequency></term>
+<term><name>1998</name><frequency>11</frequency></term>
+<term><name>1977</name><frequency>3</frequency></term>
+<term><name>1971</name><frequency>2</frequency></term>
+<term><name>1974</name><frequency>2</frequency></term>
+<term><name>1997</name><frequency>2</frequency></term>
+<term><name>1973</name><frequency>1</frequency></term>
+<term><name>1980</name><frequency>1</frequency></term>
+<term><name>1992</name><frequency>1</frequency></term>
+<term><name>1994</name><frequency>1</frequency></term>
+<term><name>1995</name><frequency>1</frequency></term>
+<term><name>1996</name><frequency>1</frequency></term>
+<term><name>2002</name><frequency>1</frequency></term>
+</list>
+</termlist>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_13.res b/test/test_limit_limitmap_13.res
new file mode 100644 (file)
index 0000000..44ad1fb
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bytarget><status>OK</status>
+<target><id>Target-1</id>
+<name>ztest-db1</name>
+<hits>10</hits>
+<diagnostic>0</diagnostic>
+<records>10</records>
+<state>Client_Idle</state>
+</target>
+<target><id>Target-2</id>
+<name>LOC-SOLR</name>
+<hits>2015</hits>
+<diagnostic>0</diagnostic>
+<records>100</records>
+<state>Client_Idle</state>
+</target></bytarget>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_14.res b/test/test_limit_limitmap_14.res
new file mode 100644 (file)
index 0000000..ab63fe6
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search><status>OK</status></search>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_15.res b/test/test_limit_limitmap_15.res
new file mode 100644 (file)
index 0000000..4060ffb
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<show><status>OK</status>
+<activeclients>0</activeclients>
+<merged>1</merged>
+<total>1</total>
+<start>0</start>
+<num>1</num>
+<hit>
+
+<md-title>The religious teachers of Greece</md-title>
+<md-date>1972</md-date>
+<md-author>Adam, James</md-author>
+<md-description>Reprint of the 1909 ed., which was issued as the 1904-1906 Gifford lectures</md-description><location id="Target-1" name="ztest-db1">
+<md-title>The religious teachers of Greece</md-title>
+<md-date>1972</md-date>
+<md-author>Adam, James</md-author>
+<md-description>Reprint of the 1909 ed., which was issued as the 1904-1906 Gifford lectures</md-description>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting></location>
+<relevance>620000</relevance>
+<recid>content: title the religious teachers of greece author adam james</recid>
+</hit>
+</show>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_16.res b/test/test_limit_limitmap_16.res
new file mode 100644 (file)
index 0000000..42534e3
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<settings><status>OK</status></settings>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_17.res b/test/test_limit_limitmap_17.res
new file mode 100644 (file)
index 0000000..ab63fe6
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search><status>OK</status></search>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_18.res b/test/test_limit_limitmap_18.res
new file mode 100644 (file)
index 0000000..101bb60
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<show><status>OK</status>
+<activeclients>0</activeclients>
+<merged>1</merged>
+<total>1</total>
+<start>0</start>
+<num>1</num>
+<hit>
+
+<md-title>The religious teachers of Greece</md-title>
+<md-date>1972</md-date>
+<md-author>Adam, James</md-author>
+<md-description>Reprint of the 1909 ed., which was issued as the 1904-1906 Gifford lectures</md-description><location id="Target-1" name="ztest-db1">
+<md-title>The religious teachers of Greece</md-title>
+<md-date>1972</md-date>
+<md-author>Adam, James</md-author>
+<md-description>Reprint of the 1909 ed., which was issued as the 1904-1906 Gifford lectures</md-description>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting></location>
+<relevance>420000</relevance>
+<recid>content: title the religious teachers of greece author adam james</recid>
+</hit>
+</show>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_19.res b/test/test_limit_limitmap_19.res
new file mode 100644 (file)
index 0000000..ab63fe6
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search><status>OK</status></search>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_2.res b/test/test_limit_limitmap_2.res
new file mode 100644 (file)
index 0000000..42534e3
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<settings><status>OK</status></settings>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_20.res b/test/test_limit_limitmap_20.res
new file mode 100644 (file)
index 0000000..2fd0767
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bytarget><status>OK</status>
+<target><id>Target-1</id>
+<name>ztest-db1</name>
+<hits>1</hits>
+<diagnostic>0</diagnostic>
+<records>1</records>
+<state>Client_Idle</state>
+</target></bytarget>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_21.res b/test/test_limit_limitmap_21.res
new file mode 100644 (file)
index 0000000..101bb60
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<show><status>OK</status>
+<activeclients>0</activeclients>
+<merged>1</merged>
+<total>1</total>
+<start>0</start>
+<num>1</num>
+<hit>
+
+<md-title>The religious teachers of Greece</md-title>
+<md-date>1972</md-date>
+<md-author>Adam, James</md-author>
+<md-description>Reprint of the 1909 ed., which was issued as the 1904-1906 Gifford lectures</md-description><location id="Target-1" name="ztest-db1">
+<md-title>The religious teachers of Greece</md-title>
+<md-date>1972</md-date>
+<md-author>Adam, James</md-author>
+<md-description>Reprint of the 1909 ed., which was issued as the 1904-1906 Gifford lectures</md-description>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting></location>
+<relevance>420000</relevance>
+<recid>content: title the religious teachers of greece author adam james</recid>
+</hit>
+</show>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_22.res b/test/test_limit_limitmap_22.res
new file mode 100644 (file)
index 0000000..42534e3
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<settings><status>OK</status></settings>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_23.res b/test/test_limit_limitmap_23.res
new file mode 100644 (file)
index 0000000..ab63fe6
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search><status>OK</status></search>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_24.res b/test/test_limit_limitmap_24.res
new file mode 100644 (file)
index 0000000..eb9920b
--- /dev/null
@@ -0,0 +1,249 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<show><status>OK</status>
+<activeclients>2</activeclients>
+<merged>40</merged>
+<total>2015</total>
+<start>0</start>
+<num>20</num>
+<hit>
+
+<md-title>Adobe Illustrator for the Mac</md-title>
+<md-title-remainder>fast &amp; easy</md-title-remainder>
+<md-date>2001</md-date>
+<md-author>Woodward, C. Michael</md-author><location id="Target-2" name="LOC-SOLR">
+<md-title>Adobe Illustrator for the Mac</md-title>
+<md-title-remainder>fast &amp; easy</md-title-remainder>
+<md-date>2001</md-date>
+<md-author>Woodward, C. Michael</md-author></location>
+<relevance>30776</relevance>
+<recid>content: title adobe illustrator for the mac author woodward c michael</recid>
+</hit>
+<hit>
+
+<md-title>Advanced computer performance modeling and simulation</md-title>
+<md-date>1998</md-date><location id="Target-2" name="LOC-SOLR">
+<md-title>Advanced computer performance modeling and simulation</md-title>
+<md-date>1998</md-date></location>
+<relevance>30776</relevance>
+<recid>content: title advanced computer performance modeling and simulation</recid>
+</hit>
+<hit>
+
+<md-title>Cyberterrorism and computer crimes</md-title>
+<md-title-remainder>issues surrounding the establishment of an international regime</md-title-remainder>
+<md-date>2000</md-date>
+<md-author>Aldrich, Richard W</md-author>
+<md-description>&quot;April 2000.&quot;</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>Cyberterrorism and computer crimes</md-title>
+<md-title-remainder>issues surrounding the establishment of an international regime</md-title-remainder>
+<md-date>2000</md-date>
+<md-author>Aldrich, Richard W</md-author>
+<md-description>&quot;April 2000.&quot;</md-description></location>
+<relevance>30776</relevance>
+<recid>content: title cyberterrorism and computer crimes author aldrich richard w</recid>
+</hit>
+<hit>
+
+<md-title>Software design and usability</md-title>
+<md-title-remainder>talks with Bonnie Nardi, Jakob Nielsen, David Smith, Austin Henderson &amp; Jed Harris, Terry Winograd, Stephanie Rosenbaum</md-title-remainder>
+<md-date>2000</md-date>
+<md-author>Kaasgaard, Klaus</md-author><location id="Target-2" name="LOC-SOLR">
+<md-title>Software design and usability</md-title>
+<md-title-remainder>talks with Bonnie Nardi, Jakob Nielsen, David Smith, Austin Henderson &amp; Jed Harris, Terry Winograd, Stephanie Rosenbaum</md-title-remainder>
+<md-date>2000</md-date>
+<md-author>Kaasgaard, Klaus</md-author></location>
+<relevance>28211</relevance>
+<recid>content: title software design and usability author kaasgaard klaus</recid>
+</hit>
+<hit>
+
+<md-title>Computer friendly</md-title>
+<md-date>1999</md-date>
+<md-author>Steinbacher, Raymond</md-author><location id="Target-2" name="LOC-SOLR">
+<md-title>Computer friendly</md-title>
+<md-date>1999</md-date>
+<md-author>Steinbacher, Raymond</md-author></location>
+<relevance>23082</relevance>
+<recid>content: title computer friendly author steinbacher raymond</recid>
+</hit>
+<hit>
+
+<md-title>Computer misuse</md-title>
+<md-date>1999</md-date>
+<md-description>&quot;Also published as Parliamentary Paper E 31AO&quot;--T.p. verso</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>Computer misuse</md-title>
+<md-date>1999</md-date>
+<md-description>&quot;May 1999.&quot;</md-description>
+<md-description>&quot;NZLC R54&quot;--T.p. verso</md-description>
+<md-description>&quot;Also published as Parliamentary Paper E 31AO&quot;--T.p. verso</md-description></location>
+<relevance>23082</relevance>
+<recid>content: title computer misuse</recid>
+</hit>
+<hit>
+
+<md-title>Unix Secure Shell</md-title>
+<md-date>1999</md-date>
+<md-author>Carasik, Anne H</md-author>
+<md-description>Includes index</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>Unix Secure Shell</md-title>
+<md-date>1999</md-date>
+<md-author>Carasik, Anne H</md-author>
+<md-description>Includes index</md-description></location>
+<relevance>23082</relevance>
+<recid>content: title unix secure shell author carasik anne h</recid>
+</hit>
+<hit>
+
+<md-title>3D games</md-title>
+<md-title-remainder>real-time rendering and software technology</md-title-remainder>
+<md-date>2001</md-date>
+<md-author>Watt, Alan H</md-author><location id="Target-2" name="LOC-SOLR">
+<md-title>3D games</md-title>
+<md-title-remainder>real-time rendering and software technology</md-title-remainder>
+<md-date>2001</md-date>
+<md-author>Watt, Alan H</md-author></location>
+<relevance>20517</relevance>
+<recid>content: title d games author watt alan h</recid>
+</hit>
+<hit>
+
+<md-title>Java applications strategies for the AS/400</md-title>
+<md-date>1999</md-date>
+<md-author>Denoncourt, Don</md-author><location id="Target-2" name="LOC-SOLR">
+<md-title>Java applications strategies for the AS/400</md-title>
+<md-date>1999</md-date>
+<md-author>Denoncourt, Don</md-author></location>
+<relevance>20517</relevance>
+<recid>content: title java applications strategies for the as author denoncourt don</recid>
+</hit>
+<hit>
+
+<md-title>Mastering algorithms with C</md-title>
+<md-date>1999</md-date>
+<md-author>Loudon, Kyle</md-author>
+<md-description>&quot;Useful techniques from sorting to encryption&quot;--Cover</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>Mastering algorithms with C</md-title>
+<md-date>1999</md-date>
+<md-author>Loudon, Kyle</md-author>
+<md-description>&quot;Useful techniques from sorting to encryption&quot;--Cover</md-description>
+<md-description>Includes index</md-description></location>
+<relevance>20517</relevance>
+<recid>content: title mastering algorithms with c author loudon kyle</recid>
+</hit>
+<hit>
+
+<md-title>Programming Web graphics with PERL and GNU software</md-title>
+<md-date>1999</md-date>
+<md-author>Wallace, Shawn P</md-author><location id="Target-2" name="LOC-SOLR">
+<md-title>Programming Web graphics with PERL and GNU software</md-title>
+<md-date>1999</md-date>
+<md-author>Wallace, Shawn P</md-author></location>
+<relevance>20517</relevance>
+<recid>content: title programming web graphics with perl and gnu software author wallace shawn p</recid>
+</hit>
+<hit>
+
+<md-title>4th ACM Conference on Computer and Communications Security, April 1-4, 1997, Zurich, Switzerland</md-title>
+<md-date>1997</md-date><location id="Target-2" name="LOC-SOLR">
+<md-title>4th ACM Conference on Computer and Communications Security, April 1-4, 1997, Zurich, Switzerland</md-title>
+<md-date>1997</md-date></location>
+<relevance>18185</relevance>
+<recid>content: title th acm conference on computer and communications security april zurich switzerland</recid>
+</hit>
+<hit>
+
+<md-title>Insanely great</md-title>
+<md-title-remainder>the life and times of Macintosh, the computer that changed everything</md-title-remainder>
+<md-date>2000</md-date>
+<md-author>Levy, Steven</md-author><location id="Target-2" name="LOC-SOLR">
+<md-title>Insanely great</md-title>
+<md-title-remainder>the life and times of Macintosh, the computer that changed everything</md-title-remainder>
+<md-date>2000</md-date>
+<md-author>Levy, Steven</md-author></location>
+<relevance>17719</relevance>
+<recid>content: title insanely great author levy steven</recid>
+</hit>
+<hit>
+
+<md-title>Careers in computer animation</md-title>
+<md-date>2001</md-date>
+<md-author>Shires, Jeremy</md-author><location id="Target-2" name="LOC-SOLR">
+<md-title>Careers in computer animation</md-title>
+<md-date>2001</md-date>
+<md-author>Shires, Jeremy</md-author></location>
+<relevance>15388</relevance>
+<recid>content: title careers in computer animation author shires jeremy</recid>
+</hit>
+<hit>
+
+<md-title>Hackers beware</md-title>
+<md-date>2002</md-date>
+<md-author>Cole, Eric</md-author><location id="Target-2" name="LOC-SOLR">
+<md-title>Hackers beware</md-title>
+<md-date>2002</md-date>
+<md-author>Cole, Eric</md-author></location>
+<relevance>15388</relevance>
+<recid>content: title hackers beware author cole eric</recid>
+</hit>
+<hit>
+
+<md-title>How computer programming works</md-title>
+<md-date>2000</md-date>
+<md-author>Appleman, Daniel</md-author><location id="Target-2" name="LOC-SOLR">
+<md-title>How computer programming works</md-title>
+<md-date>2000</md-date>
+<md-author>Appleman, Daniel</md-author></location>
+<relevance>15388</relevance>
+<recid>content: title how computer programming works author appleman daniel</recid>
+</hit>
+<hit>
+
+<md-title>Icon design</md-title>
+<md-date>2001</md-date>
+<md-author>Caplin, Steve</md-author>
+<md-description>Includes index</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>Icon design</md-title>
+<md-date>2001</md-date>
+<md-author>Caplin, Steve</md-author>
+<md-description>Includes index</md-description></location>
+<relevance>15388</relevance>
+<recid>content: title icon design author caplin steve</recid>
+</hit>
+<hit>
+
+<md-title>Information security architecture</md-title>
+<md-date>2000</md-date>
+<md-author>Tudor, Jan Killmeyer</md-author><location id="Target-2" name="LOC-SOLR">
+<md-title>Information security architecture</md-title>
+<md-date>2000</md-date>
+<md-author>Tudor, Jan Killmeyer</md-author></location>
+<relevance>15388</relevance>
+<recid>content: title information security architecture author tudor jan killmeyer</recid>
+</hit>
+<hit>
+
+<md-title>Windows 2000</md-title>
+<md-title-remainder>design &amp; migration</md-title-remainder>
+<md-date>2000</md-date>
+<md-author>Morimoto, Rand</md-author>
+<md-description>Includes index</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>Windows 2000</md-title>
+<md-title-remainder>design &amp; migration</md-title-remainder>
+<md-date>2000</md-date>
+<md-author>Morimoto, Rand</md-author>
+<md-description>Includes index</md-description></location>
+<relevance>15388</relevance>
+<recid>content: title windows author morimoto rand</recid>
+</hit>
+<hit>
+
+<md-title>The essence of computer graphics</md-title>
+<md-date>2000</md-date>
+<md-author>Cooley, Peter</md-author><location id="Target-2" name="LOC-SOLR">
+<md-title>The essence of computer graphics</md-title>
+<md-date>2000</md-date>
+<md-author>Cooley, Peter</md-author></location>
+<relevance>13849</relevance>
+<recid>content: title the essence of computer graphics author cooley peter</recid>
+</hit>
+</show>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_25.res b/test/test_limit_limitmap_25.res
new file mode 100644 (file)
index 0000000..ab63fe6
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search><status>OK</status></search>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_26.res b/test/test_limit_limitmap_26.res
new file mode 100644 (file)
index 0000000..40370c0
--- /dev/null
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<show><status>OK</status>
+<activeclients>0</activeclients>
+<merged>4</merged>
+<total>10</total>
+<start>0</start>
+<num>4</num>
+<hit>
+
+<md-title>Computer science &amp; technology</md-title>
+<md-title-remainder>proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976</md-title-remainder>
+<md-date>1977</md-date><location id="Target-1" name="ztest-db1">
+<md-title>Computer science &amp; technology</md-title>
+<md-title-remainder>proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976</md-title-remainder>
+<md-date>1977</md-date>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting></location>
+<relevance>57536</relevance>
+<recid>content: title computer science technology</recid>
+</hit>
+<hit>
+
+<md-title>The Computer Bible</md-title>
+<md-date>1973-1980</md-date>
+<md-description>Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description><location id="Target-1" name="ztest-db1">
+<md-title>The Computer Bible</md-title>
+<md-date>1973-1980</md-date>
+<md-description>Hebrew and Greek; introductions in English</md-description>
+<md-description>Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting></location>
+<relevance>57536</relevance>
+<recid>content: title the computer bible</recid>
+</hit>
+<hit>
+
+<md-title>The use of passwords for controlled access to computer resources</md-title>
+<md-date>1977</md-date>
+<md-author>Wood, Helen M</md-author><location id="Target-1" name="ztest-db1">
+<md-title>The use of passwords for controlled access to computer resources</md-title>
+<md-date>1977</md-date>
+<md-author>Wood, Helen M</md-author>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting></location>
+<relevance>17260</relevance>
+<recid>content: title the use of passwords for controlled access to computer resources author wood helen m</recid>
+</hit>
+<hit>
+
+<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
+<md-title-remainder>proceedings of the workshop</md-title-remainder>
+<md-date>1977</md-date><location id="Target-1" name="ztest-db1">
+<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
+<md-title-remainder>proceedings of the workshop</md-title-remainder>
+<md-date>1977</md-date>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting></location>
+<relevance>0</relevance>
+<recid>content: title reconstruction tomography in diagnostic radiology and nuclear medicine</recid>
+</hit>
+</show>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_27.res b/test/test_limit_limitmap_27.res
new file mode 100644 (file)
index 0000000..101bb60
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<show><status>OK</status>
+<activeclients>0</activeclients>
+<merged>1</merged>
+<total>1</total>
+<start>0</start>
+<num>1</num>
+<hit>
+
+<md-title>The religious teachers of Greece</md-title>
+<md-date>1972</md-date>
+<md-author>Adam, James</md-author>
+<md-description>Reprint of the 1909 ed., which was issued as the 1904-1906 Gifford lectures</md-description><location id="Target-1" name="ztest-db1">
+<md-title>The religious teachers of Greece</md-title>
+<md-date>1972</md-date>
+<md-author>Adam, James</md-author>
+<md-description>Reprint of the 1909 ed., which was issued as the 1904-1906 Gifford lectures</md-description>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting></location>
+<relevance>420000</relevance>
+<recid>content: title the religious teachers of greece author adam james</recid>
+</hit>
+</show>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_28.res b/test/test_limit_limitmap_28.res
new file mode 100644 (file)
index 0000000..ab63fe6
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search><status>OK</status></search>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_29.res b/test/test_limit_limitmap_29.res
new file mode 100644 (file)
index 0000000..7d1c254
--- /dev/null
@@ -0,0 +1,262 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<show><status>OK</status>
+<activeclients>1</activeclients>
+<merged>100</merged>
+<total>2015</total>
+<start>0</start>
+<num>20</num>
+<hit>
+
+<md-title>Adobe Illustrator for the Mac</md-title>
+<md-title-remainder>fast &amp; easy</md-title-remainder>
+<md-date>2001</md-date>
+<md-author>Woodward, C. Michael</md-author><location id="Target-2" name="LOC-SOLR">
+<md-title>Adobe Illustrator for the Mac</md-title>
+<md-title-remainder>fast &amp; easy</md-title-remainder>
+<md-date>2001</md-date>
+<md-author>Woodward, C. Michael</md-author></location>
+<relevance>37125</relevance>
+<recid>content: title adobe illustrator for the mac author woodward c michael</recid>
+</hit>
+<hit>
+
+<md-title>Advanced computer performance modeling and simulation</md-title>
+<md-date>1998</md-date><location id="Target-2" name="LOC-SOLR">
+<md-title>Advanced computer performance modeling and simulation</md-title>
+<md-date>1998</md-date></location>
+<relevance>37125</relevance>
+<recid>content: title advanced computer performance modeling and simulation</recid>
+</hit>
+<hit>
+
+<md-title>Cyberterrorism and computer crimes</md-title>
+<md-title-remainder>issues surrounding the establishment of an international regime</md-title-remainder>
+<md-date>2000</md-date>
+<md-author>Aldrich, Richard W</md-author>
+<md-description>&quot;April 2000.&quot;</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>Cyberterrorism and computer crimes</md-title>
+<md-title-remainder>issues surrounding the establishment of an international regime</md-title-remainder>
+<md-date>2000</md-date>
+<md-author>Aldrich, Richard W</md-author>
+<md-description>&quot;April 2000.&quot;</md-description></location>
+<relevance>37125</relevance>
+<recid>content: title cyberterrorism and computer crimes author aldrich richard w</recid>
+</hit>
+<hit>
+
+<md-title>Computer interfacing</md-title>
+<md-date>2000</md-date>
+<md-author>Smith, George A</md-author><location id="Target-2" name="LOC-SOLR">
+<md-title>Computer interfacing</md-title>
+<md-date>2000</md-date>
+<md-author>Smith, George A</md-author></location>
+<relevance>34031</relevance>
+<recid>content: title computer interfacing author smith george a</recid>
+</hit>
+<hit>
+
+<md-title>Software design and usability</md-title>
+<md-title-remainder>talks with Bonnie Nardi, Jakob Nielsen, David Smith, Austin Henderson &amp; Jed Harris, Terry Winograd, Stephanie Rosenbaum</md-title-remainder>
+<md-date>2000</md-date>
+<md-author>Kaasgaard, Klaus</md-author><location id="Target-2" name="LOC-SOLR">
+<md-title>Software design and usability</md-title>
+<md-title-remainder>talks with Bonnie Nardi, Jakob Nielsen, David Smith, Austin Henderson &amp; Jed Harris, Terry Winograd, Stephanie Rosenbaum</md-title-remainder>
+<md-date>2000</md-date>
+<md-author>Kaasgaard, Klaus</md-author></location>
+<relevance>34031</relevance>
+<recid>content: title software design and usability author kaasgaard klaus</recid>
+</hit>
+<hit>
+
+<md-title>Everything you need to know about the dangers of computer hacking</md-title>
+<md-date>2000</md-date>
+<md-author>Knittel, John</md-author>
+<md-description>Explains what computer hacking is, who does it, and how dangerous it can be</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>Everything you need to know about the dangers of computer hacking</md-title>
+<md-date>2000</md-date>
+<md-author>Knittel, John</md-author>
+<md-description>Explains what computer hacking is, who does it, and how dangerous it can be</md-description></location>
+<relevance>32544</relevance>
+<recid>content: title everything you need to know about the dangers of computer hacking author knittel john</recid>
+</hit>
+<hit>
+
+<md-title>Computer peripherals</md-title>
+<md-date>1995</md-date>
+<md-author>Cook, Barry M</md-author><location id="Target-2" name="LOC-SOLR">
+<md-title>Computer peripherals</md-title>
+<md-date>1995</md-date>
+<md-author>Cook, Barry M</md-author></location>
+<relevance>32484</relevance>
+<recid>content: title computer peripherals author cook barry m</recid>
+</hit>
+<hit>
+
+<md-title>Kids&apos; computer book</md-title>
+<md-date>1994</md-date>
+<md-description>Discusses a variety of educational and game software for children  with suggestions for setting up a computer system. Includes a 3 1/2 in. disk with 6 shareware programs for children</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>Kids&apos; computer book</md-title>
+<md-date>1994</md-date>
+<md-description>&quot;For kids and their parents&quot;--Cover</md-description>
+<md-description>Discusses a variety of educational and game software for children  with suggestions for setting up a computer system. Includes a 3 1/2 in. disk with 6 shareware programs for children</md-description></location>
+<relevance>28531</relevance>
+<recid>content: title kids computer book</recid>
+</hit>
+<hit>
+
+<md-title>Computer friendly</md-title>
+<md-date>1999</md-date>
+<md-author>Steinbacher, Raymond</md-author><location id="Target-2" name="LOC-SOLR">
+<md-title>Computer friendly</md-title>
+<md-date>1999</md-date>
+<md-author>Steinbacher, Raymond</md-author></location>
+<relevance>27843</relevance>
+<recid>content: title computer friendly author steinbacher raymond</recid>
+</hit>
+<hit>
+
+<md-title>Computer misuse</md-title>
+<md-date>1999</md-date>
+<md-description>&quot;Also published as Parliamentary Paper E 31AO&quot;--T.p. verso</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>Computer misuse</md-title>
+<md-date>1999</md-date>
+<md-description>&quot;May 1999.&quot;</md-description>
+<md-description>&quot;NZLC R54&quot;--T.p. verso</md-description>
+<md-description>&quot;Also published as Parliamentary Paper E 31AO&quot;--T.p. verso</md-description></location>
+<relevance>27843</relevance>
+<recid>content: title computer misuse</recid>
+</hit>
+<hit>
+
+<md-title>Computer networking</md-title>
+<md-title-remainder>a top-down approach featuring the Internet</md-title-remainder>
+<md-date>2001</md-date>
+<md-author>Ross, Keith W</md-author><location id="Target-2" name="LOC-SOLR">
+<md-title>Computer networking</md-title>
+<md-title-remainder>a top-down approach featuring the Internet</md-title-remainder>
+<md-date>2001</md-date>
+<md-author>Ross, Keith W</md-author></location>
+<relevance>27843</relevance>
+<recid>content: title computer networking author ross keith w</recid>
+</hit>
+<hit>
+
+<md-title>CorelDRAW 8 for Windows</md-title>
+<md-date>1998</md-date>
+<md-author>Davis, Phyllis</md-author>
+<md-description>Includes index</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>CorelDRAW 8 for Windows</md-title>
+<md-date>1998</md-date>
+<md-author>Davis, Phyllis</md-author>
+<md-description>Includes index</md-description></location>
+<relevance>27843</relevance>
+<recid>content: title coreldraw for windows author davis phyllis</recid>
+</hit>
+<hit>
+
+<md-title>Quicken 2001 Deluxe for Macintosh</md-title>
+<md-title-remainder>the official guide</md-title-remainder>
+<md-date>2001</md-date>
+<md-author>Langer, Maria</md-author>
+<md-description>Includes index</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>Quicken 2001 Deluxe for Macintosh</md-title>
+<md-title-remainder>the official guide</md-title-remainder>
+<md-date>2001</md-date>
+<md-author>Langer, Maria</md-author>
+<md-description>Includes index</md-description></location>
+<relevance>27843</relevance>
+<recid>content: title quicken deluxe for macintosh author langer maria</recid>
+</hit>
+<hit>
+
+<md-title>Quicken 2000 for the Mac</md-title>
+<md-title-remainder>the official guide</md-title-remainder>
+<md-date>2000</md-date>
+<md-author>Langer, Maria</md-author>
+<md-description>&quot;Covers Quicken deluxe 2000 for the Mac&quot;--Cover</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>Quicken 2000 for the Mac</md-title>
+<md-title-remainder>the official guide</md-title-remainder>
+<md-date>2000</md-date>
+<md-author>Langer, Maria</md-author>
+<md-description>Includes index</md-description>
+<md-description>&quot;Covers Quicken deluxe 2000 for the Mac&quot;--Cover</md-description></location>
+<relevance>27843</relevance>
+<recid>content: title quicken for the mac author langer maria</recid>
+</hit>
+<hit>
+
+<md-title>Sicherheit und Schutz im Netz</md-title>
+<md-date>1998</md-date><location id="Target-2" name="LOC-SOLR">
+<md-title>Sicherheit und Schutz im Netz</md-title>
+<md-date>1998</md-date></location>
+<relevance>27843</relevance>
+<recid>content: title sicherheit und schutz im netz</recid>
+</hit>
+<hit>
+
+<md-title>Unix Secure Shell</md-title>
+<md-date>1999</md-date>
+<md-author>Carasik, Anne H</md-author>
+<md-description>Includes index</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>Unix Secure Shell</md-title>
+<md-date>1999</md-date>
+<md-author>Carasik, Anne H</md-author>
+<md-description>Includes index</md-description></location>
+<relevance>27843</relevance>
+<recid>content: title unix secure shell author carasik anne h</recid>
+</hit>
+<hit>
+
+<md-title>www.StopThief.net</md-title>
+<md-title-remainder>protecting your identity on the Web</md-title-remainder>
+<md-date>1999</md-date>
+<md-author>Marcella, Albert J</md-author><location id="Target-2" name="LOC-SOLR">
+<md-title>www.StopThief.net</md-title>
+<md-title-remainder>protecting your identity on the Web</md-title-remainder>
+<md-date>1999</md-date>
+<md-author>Marcella, Albert J</md-author></location>
+<relevance>27843</relevance>
+<recid>content: title www stopthief net author marcella albert j</recid>
+</hit>
+<hit>
+
+<md-title>Eight International Conference on Computer Communications and Networks</md-title>
+<md-title-remainder>proceedings, 11-13 October 1999, Boston, Massachusetts</md-title-remainder>
+<md-date>1999</md-date>
+<md-description>&quot;IEEE catalog number 99EX370&quot;--T.p. verso</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>Eight International Conference on Computer Communications and Networks</md-title>
+<md-title-remainder>proceedings, 11-13 October 1999, Boston, Massachusetts</md-title-remainder>
+<md-date>1999</md-date>
+<md-description>&quot;IEEE catalog number 99EX370&quot;--T.p. verso</md-description></location>
+<relevance>26297</relevance>
+<recid>content: title eight international conference on computer communications and networks</recid>
+</hit>
+<hit>
+
+<md-title>Building storage networks</md-title>
+<md-date>2000</md-date>
+<md-author>Farley, Marc</md-author>
+<md-description>Includes index</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>Building storage networks</md-title>
+<md-date>2000</md-date>
+<md-author>Farley, Marc</md-author>
+<md-description>Includes index</md-description></location>
+<relevance>24750</relevance>
+<recid>content: title building storage networks author farley marc</recid>
+</hit>
+<hit>
+
+<md-title>Complete CL</md-title>
+<md-title-remainder>the definitive control language programming guide</md-title-remainder>
+<md-date>1999</md-date>
+<md-author>Malaga, Ernie</md-author>
+<md-description>Includes index</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>Complete CL</md-title>
+<md-title-remainder>the definitive control language programming guide</md-title-remainder>
+<md-date>1999</md-date>
+<md-author>Malaga, Ernie</md-author>
+<md-description>Includes index</md-description></location>
+<relevance>24750</relevance>
+<recid>content: title complete cl author malaga ernie</recid>
+</hit>
+</show>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_3.res b/test/test_limit_limitmap_3.res
new file mode 100644 (file)
index 0000000..ab63fe6
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search><status>OK</status></search>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_30.res b/test/test_limit_limitmap_30.res
new file mode 100644 (file)
index 0000000..ab63fe6
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search><status>OK</status></search>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_31.res b/test/test_limit_limitmap_31.res
new file mode 100644 (file)
index 0000000..e1a4919
--- /dev/null
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<show><status>OK</status>
+<activeclients>0</activeclients>
+<merged>4</merged>
+<total>2025</total>
+<start>0</start>
+<num>4</num>
+<hit>
+
+<md-title>Computer science &amp; technology</md-title>
+<md-title-remainder>proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976</md-title-remainder>
+<md-date>1977</md-date><location id="Target-1" name="ztest-db1">
+<md-title>Computer science &amp; technology</md-title>
+<md-title-remainder>proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976</md-title-remainder>
+<md-date>1977</md-date>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting></location>
+<relevance>57536</relevance>
+<recid>content: title computer science technology</recid>
+</hit>
+<hit>
+
+<md-title>The Computer Bible</md-title>
+<md-date>1973-1980</md-date>
+<md-description>Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description><location id="Target-1" name="ztest-db1">
+<md-title>The Computer Bible</md-title>
+<md-date>1973-1980</md-date>
+<md-description>Hebrew and Greek; introductions in English</md-description>
+<md-description>Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting></location>
+<relevance>57536</relevance>
+<recid>content: title the computer bible</recid>
+</hit>
+<hit>
+
+<md-title>The use of passwords for controlled access to computer resources</md-title>
+<md-date>1977</md-date>
+<md-author>Wood, Helen M</md-author><location id="Target-1" name="ztest-db1">
+<md-title>The use of passwords for controlled access to computer resources</md-title>
+<md-date>1977</md-date>
+<md-author>Wood, Helen M</md-author>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting></location>
+<relevance>17260</relevance>
+<recid>content: title the use of passwords for controlled access to computer resources author wood helen m</recid>
+</hit>
+<hit>
+
+<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
+<md-title-remainder>proceedings of the workshop</md-title-remainder>
+<md-date>1977</md-date><location id="Target-1" name="ztest-db1">
+<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
+<md-title-remainder>proceedings of the workshop</md-title-remainder>
+<md-date>1977</md-date>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting></location>
+<relevance>0</relevance>
+<recid>content: title reconstruction tomography in diagnostic radiology and nuclear medicine</recid>
+</hit>
+</show>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_4.res b/test/test_limit_limitmap_4.res
new file mode 100644 (file)
index 0000000..59095d8
--- /dev/null
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<show><status>OK</status>
+<activeclients>0</activeclients>
+<merged>9</merged>
+<total>10</total>
+<start>0</start>
+<num>9</num>
+<hit>
+
+<md-title>How to program a computer</md-title>
+<md-author>Jack Collins</md-author><location id="Target-1" name="ztest-db1">
+<md-title>How to program a computer</md-title>
+<md-author>Jack Collins</md-author>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting></location>
+<location id="Target-1" name="ztest-db1">
+<md-title>How to program a computer</md-title>
+<md-author>Jack Collins</md-author>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting></location>
+<count>2</count>
+<relevance>25286</relevance>
+<recid>content: title how to program a computer author jack collins</recid>
+</hit>
+<hit>
+
+<md-title>Computer science &amp; technology</md-title>
+<md-title-remainder>proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976</md-title-remainder>
+<md-date>1977</md-date><location id="Target-1" name="ztest-db1">
+<md-title>Computer science &amp; technology</md-title>
+<md-title-remainder>proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976</md-title-remainder>
+<md-date>1977</md-date>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting></location>
+<relevance>21072</relevance>
+<recid>content: title computer science technology</recid>
+</hit>
+<hit>
+
+<md-title>The Computer Bible</md-title>
+<md-date>1973-1980</md-date>
+<md-description>Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description><location id="Target-1" name="ztest-db1">
+<md-title>The Computer Bible</md-title>
+<md-date>1973-1980</md-date>
+<md-description>Hebrew and Greek; introductions in English</md-description>
+<md-description>Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting></location>
+<relevance>21072</relevance>
+<recid>content: title the computer bible</recid>
+</hit>
+<hit>
+
+<md-title>A plan for community college computer development</md-title>
+<md-date>1971</md-date>
+<md-description>Cover title</md-description><location id="Target-1" name="ztest-db1">
+<md-title>A plan for community college computer development</md-title>
+<md-date>1971</md-date>
+<md-description>Cover title</md-description>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting></location>
+<relevance>9030</relevance>
+<recid>content: title a plan for community college computer development</recid>
+</hit>
+<hit>
+
+<md-title>Washington metropolitan area rail computer feasibility study;</md-title>
+<md-title-remainder>final report</md-title-remainder>
+<md-date>1971</md-date>
+<md-author>Englund, Carl R</md-author>
+<md-description>&quot;Contract DOT-UT-10003.&quot;</md-description><location id="Target-1" name="ztest-db1">
+<md-title>Washington metropolitan area rail computer feasibility study;</md-title>
+<md-title-remainder>final report</md-title-remainder>
+<md-date>1971</md-date>
+<md-author>Englund, Carl R</md-author>
+<md-description>&quot;Contract DOT-UT-10003.&quot;</md-description>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting></location>
+<relevance>9030</relevance>
+<recid>content: title washington metropolitan area rail computer feasibility study author englund carl r</recid>
+</hit>
+<hit>
+
+<md-title>The Puget Sound Region</md-title>
+<md-title-remainder>a portfolio of thematic computer maps</md-title-remainder>
+<md-date>1974</md-date>
+<md-author>Mairs, John W</md-author>
+<md-description>Scale of maps ca. 1:1,000,000</md-description><location id="Target-1" name="ztest-db1">
+<md-title>The Puget Sound Region</md-title>
+<md-title-remainder>a portfolio of thematic computer maps</md-title-remainder>
+<md-date>1974</md-date>
+<md-author>Mairs, John W</md-author>
+<md-description>Scale of maps ca. 1:1,000,000</md-description>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting></location>
+<relevance>8780</relevance>
+<recid>content: title the puget sound region author mairs john w</recid>
+</hit>
+<hit>
+
+<md-title>Computer processing of dynamic images from an Anger scintillation camera</md-title>
+<md-title-remainder>the proceedings of a workshop</md-title-remainder>
+<md-date>1974</md-date><location id="Target-1" name="ztest-db1">
+<md-title>Computer processing of dynamic images from an Anger scintillation camera</md-title>
+<md-title-remainder>the proceedings of a workshop</md-title-remainder>
+<md-date>1974</md-date>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting></location>
+<relevance>6321</relevance>
+<recid>content: title computer processing of dynamic images from an anger scintillation camera</recid>
+</hit>
+<hit>
+
+<md-title>The use of passwords for controlled access to computer resources</md-title>
+<md-date>1977</md-date>
+<md-author>Wood, Helen M</md-author><location id="Target-1" name="ztest-db1">
+<md-title>The use of passwords for controlled access to computer resources</md-title>
+<md-date>1977</md-date>
+<md-author>Wood, Helen M</md-author>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting></location>
+<relevance>6321</relevance>
+<recid>content: title the use of passwords for controlled access to computer resources author wood helen m</recid>
+</hit>
+<hit>
+
+<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
+<md-title-remainder>proceedings of the workshop</md-title-remainder>
+<md-date>1977</md-date><location id="Target-1" name="ztest-db1">
+<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
+<md-title-remainder>proceedings of the workshop</md-title-remainder>
+<md-date>1977</md-date>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting></location>
+<relevance>0</relevance>
+<recid>content: title reconstruction tomography in diagnostic radiology and nuclear medicine</recid>
+</hit>
+</show>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_4.xml b/test/test_limit_limitmap_4.xml
new file mode 100644 (file)
index 0000000..117f75a
--- /dev/null
@@ -0,0 +1,4 @@
+<settings target="ID_1">
+  <set name="pz:limitmap:author"  value="rpn:@attr 1=1003 @attr 6=3" />
+  <set name="pz:limitmap:subject" value="rpn:@attr 1=21 @attr 6=3" />
+</settings>
diff --git a/test/test_limit_limitmap_5.res b/test/test_limit_limitmap_5.res
new file mode 100644 (file)
index 0000000..7735835
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bytarget><status>OK</status>
+<target><id>Target-1</id>
+<name>ztest-db1</name>
+<hits>10</hits>
+<diagnostic>0</diagnostic>
+<records>10</records>
+<state>Client_Idle</state>
+</target></bytarget>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_6.res b/test/test_limit_limitmap_6.res
new file mode 100644 (file)
index 0000000..f05429f
--- /dev/null
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<termlist><activeclients>0</activeclients>
+<list name="xtargets">
+<term>
+<id>Target-1</id>
+<name>ztest-db1</name>
+<frequency>10</frequency>
+<state>Client_Idle</state>
+<diagnostic>0</diagnostic>
+</term>
+</list>
+<list name="author">
+<term><name>Jack Collins</name><frequency>2</frequency></term>
+<term><name>Englund, Carl R</name><frequency>1</frequency></term>
+<term><name>Mairs, John W</name><frequency>1</frequency></term>
+<term><name>Wood, Helen M</name><frequency>1</frequency></term>
+</list>
+<list name="subject">
+<term><name>Bible</name><frequency>1</frequency></term>
+<term><name>Bible. O.T</name><frequency>1</frequency></term>
+<term><name>Cartography</name><frequency>1</frequency></term>
+<term><name>Community colleges</name><frequency>1</frequency></term>
+<term><name>Computers</name><frequency>1</frequency></term>
+<term><name>Imaging systems in medicine</name><frequency>1</frequency></term>
+<term><name>Optical pattern recognition</name><frequency>1</frequency></term>
+<term><name>Puget Sound region (Wash.)</name><frequency>1</frequency></term>
+<term><name>Radioisotope scanning</name><frequency>1</frequency></term>
+<term><name>Railroads</name><frequency>1</frequency></term>
+<term><name>Scintillation cameras</name><frequency>1</frequency></term>
+<term><name>Tomography</name><frequency>1</frequency></term>
+<term><name>Universities and colleges</name><frequency>1</frequency></term>
+</list>
+<list name="date">
+<term><name>1977</name><frequency>3</frequency></term>
+<term><name>1971</name><frequency>2</frequency></term>
+<term><name>1974</name><frequency>2</frequency></term>
+<term><name>1973</name><frequency>1</frequency></term>
+<term><name>1980</name><frequency>1</frequency></term>
+</list>
+</termlist>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_7.res b/test/test_limit_limitmap_7.res
new file mode 100644 (file)
index 0000000..42534e3
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<settings><status>OK</status></settings>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_8.res b/test/test_limit_limitmap_8.res
new file mode 100644 (file)
index 0000000..ab63fe6
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search><status>OK</status></search>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_9.res b/test/test_limit_limitmap_9.res
new file mode 100644 (file)
index 0000000..3521921
--- /dev/null
@@ -0,0 +1,262 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<show><status>OK</status>
+<activeclients>0</activeclients>
+<merged>109</merged>
+<total>2025</total>
+<start>0</start>
+<num>20</num>
+<hit>
+
+<md-title>Adobe Illustrator for the Mac</md-title>
+<md-title-remainder>fast &amp; easy</md-title-remainder>
+<md-date>2001</md-date>
+<md-author>Woodward, C. Michael</md-author><location id="Target-2" name="LOC-SOLR">
+<md-title>Adobe Illustrator for the Mac</md-title>
+<md-title-remainder>fast &amp; easy</md-title-remainder>
+<md-date>2001</md-date>
+<md-author>Woodward, C. Michael</md-author></location>
+<relevance>39450</relevance>
+<recid>content: title adobe illustrator for the mac author woodward c michael</recid>
+</hit>
+<hit>
+
+<md-title>Advanced computer performance modeling and simulation</md-title>
+<md-date>1998</md-date><location id="Target-2" name="LOC-SOLR">
+<md-title>Advanced computer performance modeling and simulation</md-title>
+<md-date>1998</md-date></location>
+<relevance>39450</relevance>
+<recid>content: title advanced computer performance modeling and simulation</recid>
+</hit>
+<hit>
+
+<md-title>Cyberterrorism and computer crimes</md-title>
+<md-title-remainder>issues surrounding the establishment of an international regime</md-title-remainder>
+<md-date>2000</md-date>
+<md-author>Aldrich, Richard W</md-author>
+<md-description>&quot;April 2000.&quot;</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>Cyberterrorism and computer crimes</md-title>
+<md-title-remainder>issues surrounding the establishment of an international regime</md-title-remainder>
+<md-date>2000</md-date>
+<md-author>Aldrich, Richard W</md-author>
+<md-description>&quot;April 2000.&quot;</md-description></location>
+<relevance>39450</relevance>
+<recid>content: title cyberterrorism and computer crimes author aldrich richard w</recid>
+</hit>
+<hit>
+
+<md-title>Computer interfacing</md-title>
+<md-date>2000</md-date>
+<md-author>Smith, George A</md-author><location id="Target-2" name="LOC-SOLR">
+<md-title>Computer interfacing</md-title>
+<md-date>2000</md-date>
+<md-author>Smith, George A</md-author></location>
+<relevance>36163</relevance>
+<recid>content: title computer interfacing author smith george a</recid>
+</hit>
+<hit>
+
+<md-title>Software design and usability</md-title>
+<md-title-remainder>talks with Bonnie Nardi, Jakob Nielsen, David Smith, Austin Henderson &amp; Jed Harris, Terry Winograd, Stephanie Rosenbaum</md-title-remainder>
+<md-date>2000</md-date>
+<md-author>Kaasgaard, Klaus</md-author><location id="Target-2" name="LOC-SOLR">
+<md-title>Software design and usability</md-title>
+<md-title-remainder>talks with Bonnie Nardi, Jakob Nielsen, David Smith, Austin Henderson &amp; Jed Harris, Terry Winograd, Stephanie Rosenbaum</md-title-remainder>
+<md-date>2000</md-date>
+<md-author>Kaasgaard, Klaus</md-author></location>
+<relevance>36163</relevance>
+<recid>content: title software design and usability author kaasgaard klaus</recid>
+</hit>
+<hit>
+
+<md-title>Everything you need to know about the dangers of computer hacking</md-title>
+<md-date>2000</md-date>
+<md-author>Knittel, John</md-author>
+<md-description>Explains what computer hacking is, who does it, and how dangerous it can be</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>Everything you need to know about the dangers of computer hacking</md-title>
+<md-date>2000</md-date>
+<md-author>Knittel, John</md-author>
+<md-description>Explains what computer hacking is, who does it, and how dangerous it can be</md-description></location>
+<relevance>34583</relevance>
+<recid>content: title everything you need to know about the dangers of computer hacking author knittel john</recid>
+</hit>
+<hit>
+
+<md-title>Computer peripherals</md-title>
+<md-date>1995</md-date>
+<md-author>Cook, Barry M</md-author><location id="Target-2" name="LOC-SOLR">
+<md-title>Computer peripherals</md-title>
+<md-date>1995</md-date>
+<md-author>Cook, Barry M</md-author></location>
+<relevance>34519</relevance>
+<recid>content: title computer peripherals author cook barry m</recid>
+</hit>
+<hit>
+
+<md-title>Kids&apos; computer book</md-title>
+<md-date>1994</md-date>
+<md-description>Discusses a variety of educational and game software for children  with suggestions for setting up a computer system. Includes a 3 1/2 in. disk with 6 shareware programs for children</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>Kids&apos; computer book</md-title>
+<md-date>1994</md-date>
+<md-description>&quot;For kids and their parents&quot;--Cover</md-description>
+<md-description>Discusses a variety of educational and game software for children  with suggestions for setting up a computer system. Includes a 3 1/2 in. disk with 6 shareware programs for children</md-description></location>
+<relevance>30318</relevance>
+<recid>content: title kids computer book</recid>
+</hit>
+<hit>
+
+<md-title>Computer friendly</md-title>
+<md-date>1999</md-date>
+<md-author>Steinbacher, Raymond</md-author><location id="Target-2" name="LOC-SOLR">
+<md-title>Computer friendly</md-title>
+<md-date>1999</md-date>
+<md-author>Steinbacher, Raymond</md-author></location>
+<relevance>29588</relevance>
+<recid>content: title computer friendly author steinbacher raymond</recid>
+</hit>
+<hit>
+
+<md-title>Computer misuse</md-title>
+<md-date>1999</md-date>
+<md-description>&quot;Also published as Parliamentary Paper E 31AO&quot;--T.p. verso</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>Computer misuse</md-title>
+<md-date>1999</md-date>
+<md-description>&quot;May 1999.&quot;</md-description>
+<md-description>&quot;NZLC R54&quot;--T.p. verso</md-description>
+<md-description>&quot;Also published as Parliamentary Paper E 31AO&quot;--T.p. verso</md-description></location>
+<relevance>29588</relevance>
+<recid>content: title computer misuse</recid>
+</hit>
+<hit>
+
+<md-title>Computer networking</md-title>
+<md-title-remainder>a top-down approach featuring the Internet</md-title-remainder>
+<md-date>2001</md-date>
+<md-author>Ross, Keith W</md-author><location id="Target-2" name="LOC-SOLR">
+<md-title>Computer networking</md-title>
+<md-title-remainder>a top-down approach featuring the Internet</md-title-remainder>
+<md-date>2001</md-date>
+<md-author>Ross, Keith W</md-author></location>
+<relevance>29588</relevance>
+<recid>content: title computer networking author ross keith w</recid>
+</hit>
+<hit>
+
+<md-title>CorelDRAW 8 for Windows</md-title>
+<md-date>1998</md-date>
+<md-author>Davis, Phyllis</md-author>
+<md-description>Includes index</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>CorelDRAW 8 for Windows</md-title>
+<md-date>1998</md-date>
+<md-author>Davis, Phyllis</md-author>
+<md-description>Includes index</md-description></location>
+<relevance>29588</relevance>
+<recid>content: title coreldraw for windows author davis phyllis</recid>
+</hit>
+<hit>
+
+<md-title>Quicken 2001 Deluxe for Macintosh</md-title>
+<md-title-remainder>the official guide</md-title-remainder>
+<md-date>2001</md-date>
+<md-author>Langer, Maria</md-author>
+<md-description>Includes index</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>Quicken 2001 Deluxe for Macintosh</md-title>
+<md-title-remainder>the official guide</md-title-remainder>
+<md-date>2001</md-date>
+<md-author>Langer, Maria</md-author>
+<md-description>Includes index</md-description></location>
+<relevance>29588</relevance>
+<recid>content: title quicken deluxe for macintosh author langer maria</recid>
+</hit>
+<hit>
+
+<md-title>Quicken 2000 for the Mac</md-title>
+<md-title-remainder>the official guide</md-title-remainder>
+<md-date>2000</md-date>
+<md-author>Langer, Maria</md-author>
+<md-description>&quot;Covers Quicken deluxe 2000 for the Mac&quot;--Cover</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>Quicken 2000 for the Mac</md-title>
+<md-title-remainder>the official guide</md-title-remainder>
+<md-date>2000</md-date>
+<md-author>Langer, Maria</md-author>
+<md-description>Includes index</md-description>
+<md-description>&quot;Covers Quicken deluxe 2000 for the Mac&quot;--Cover</md-description></location>
+<relevance>29588</relevance>
+<recid>content: title quicken for the mac author langer maria</recid>
+</hit>
+<hit>
+
+<md-title>Sicherheit und Schutz im Netz</md-title>
+<md-date>1998</md-date><location id="Target-2" name="LOC-SOLR">
+<md-title>Sicherheit und Schutz im Netz</md-title>
+<md-date>1998</md-date></location>
+<relevance>29588</relevance>
+<recid>content: title sicherheit und schutz im netz</recid>
+</hit>
+<hit>
+
+<md-title>Unix Secure Shell</md-title>
+<md-date>1999</md-date>
+<md-author>Carasik, Anne H</md-author>
+<md-description>Includes index</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>Unix Secure Shell</md-title>
+<md-date>1999</md-date>
+<md-author>Carasik, Anne H</md-author>
+<md-description>Includes index</md-description></location>
+<relevance>29588</relevance>
+<recid>content: title unix secure shell author carasik anne h</recid>
+</hit>
+<hit>
+
+<md-title>www.StopThief.net</md-title>
+<md-title-remainder>protecting your identity on the Web</md-title-remainder>
+<md-date>1999</md-date>
+<md-author>Marcella, Albert J</md-author><location id="Target-2" name="LOC-SOLR">
+<md-title>www.StopThief.net</md-title>
+<md-title-remainder>protecting your identity on the Web</md-title-remainder>
+<md-date>1999</md-date>
+<md-author>Marcella, Albert J</md-author></location>
+<relevance>29588</relevance>
+<recid>content: title www stopthief net author marcella albert j</recid>
+</hit>
+<hit>
+
+<md-title>Eight International Conference on Computer Communications and Networks</md-title>
+<md-title-remainder>proceedings, 11-13 October 1999, Boston, Massachusetts</md-title-remainder>
+<md-date>1999</md-date>
+<md-description>&quot;IEEE catalog number 99EX370&quot;--T.p. verso</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>Eight International Conference on Computer Communications and Networks</md-title>
+<md-title-remainder>proceedings, 11-13 October 1999, Boston, Massachusetts</md-title-remainder>
+<md-date>1999</md-date>
+<md-description>&quot;IEEE catalog number 99EX370&quot;--T.p. verso</md-description></location>
+<relevance>27944</relevance>
+<recid>content: title eight international conference on computer communications and networks</recid>
+</hit>
+<hit>
+
+<md-title>Building storage networks</md-title>
+<md-date>2000</md-date>
+<md-author>Farley, Marc</md-author>
+<md-description>Includes index</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>Building storage networks</md-title>
+<md-date>2000</md-date>
+<md-author>Farley, Marc</md-author>
+<md-description>Includes index</md-description></location>
+<relevance>26300</relevance>
+<recid>content: title building storage networks author farley marc</recid>
+</hit>
+<hit>
+
+<md-title>Complete CL</md-title>
+<md-title-remainder>the definitive control language programming guide</md-title-remainder>
+<md-date>1999</md-date>
+<md-author>Malaga, Ernie</md-author>
+<md-description>Includes index</md-description><location id="Target-2" name="LOC-SOLR">
+<md-title>Complete CL</md-title>
+<md-title-remainder>the definitive control language programming guide</md-title-remainder>
+<md-date>1999</md-date>
+<md-author>Malaga, Ernie</md-author>
+<md-description>Includes index</md-description></location>
+<relevance>26300</relevance>
+<recid>content: title complete cl author malaga ernie</recid>
+</hit>
+</show>
\ No newline at end of file
diff --git a/test/test_limit_limitmap_service.xml b/test/test_limit_limitmap_service.xml
new file mode 100644 (file)
index 0000000..b9b45dd
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<service id="limitmap">
+
+  <settings target="*">
+    <set name="pz:limitmap:author" value="ccl:au" />
+    <set name="pz:limitmap:date"   value="local:" />
+    <set name="pz:limitmap:subject" value="rpn: @attr 1=21 @attr 6=3" />
+  </settings>
+
+  <set name="service" value="from-service" />
+
+  <metadata name="id"/>
+  <metadata name="url" merge="unique"/>
+  <metadata name="title" brief="yes" sortkey="skiparticle" merge="longest" rank="6" mergekey="required" />
+  <metadata name="title-remainder" brief="yes" merge="longest" rank="5"/>
+  <metadata name="isbn"/>
+
+  <metadata name="date" brief="yes" sortkey="numeric" type="year" merge="range" termlist="yes" limitmap="local:" />
+  <metadata name="author" brief="yes" termlist="yes" merge="longest" rank="2" mergekey="optional" limitmap="ccl:au" />
+  <metadata name="subject" merge="unique" termlist="yes" rank="3" limitmap="rpn: @attr 1=21 @attr 6=3" />
+
+  <metadata name="description" brief="yes" merge="longest" rank="3" />
+  <metadata name="lccn" merge="unique"/>
+  <metadata name="title-complete" />
+  <metadata name="publication-place" />
+  
+  <metadata name="test-usersetting" brief="yes" setting="postproc"/>
+  <metadata name="test" setting="parameter"/>
+  <metadata name="test-usersetting-2" brief="yes"/>
+</service>
diff --git a/test/test_limit_limitmap_settings_1.xml b/test/test_limit_limitmap_settings_1.xml
new file mode 100644 (file)
index 0000000..fe94c47
--- /dev/null
@@ -0,0 +1,34 @@
+<!-- ztest --> 
+<settings target="Target-1">
+  <set name="pz:name" value="ztest-db1"/>
+  <set name="pz:url" value="z3950.indexdata.com/marc"/>
+
+  <!-- mapping for unqualified search -->
+  <set name="pz:cclmap:term" value="u=1016 t=l,r s=al"/>
+
+  <!-- field-specific mappings -->
+  <set name="pz:cclmap:ti" value="u=4 s=al"/>
+  <set name="pz:cclmap:su" value="u=21 s=al"/>
+  <set name="pz:cclmap:isbn" value="u=7"/>
+  <set name="pz:cclmap:issn" value="u=8"/>
+  <set name="pz:cclmap:date" value="u=30 r=r"/>
+  <set name="pz:cclmap:au" value="u=1003"/>
+
+  <!-- Retrieval settings -->
+
+  <set name="pz:requestsyntax" value="marc21"/>
+
+  <!-- Result normalization settings -->
+
+  <set name="pz:nativesyntax" value="txml"/>
+  <set name="pz:xslt" value="tmarc.xsl"/>
+  
+  <set name="pz:apdulog" value="1"/>
+  <set name="pz:pqf_strftime" value="@or %% %Y"/>
+
+  <!-- Examples of application-specific setting -->
+  <!-- Available in output record and/or normalization stylesheet -->
+  <set name="test-usersetting" value="XXXXXXXXXX"/>
+  <set name="test" value="YYYYYYYYY"/>
+
+</settings>
diff --git a/test/test_limit_limitmap_settings_2.xml b/test/test_limit_limitmap_settings_2.xml
new file mode 100644 (file)
index 0000000..4fbbdf2
--- /dev/null
@@ -0,0 +1,30 @@
+<!-- Solr target -->
+<settings target="Target-2">
+  <set name="pz:name"  value="LOC-SOLR" />
+  <set name="pz:url"   value="ocs-test.indexdata.com/solr/select" />
+
+  <set name="pz:limitmap:author"  value="ccl:author_phrase" />
+  <set name="pz:limitmap:subject" value="rpn:@attr 1=subject_exact" />
+  <set name="pz:limitmap:date"    value="rpn:@attr 1=date @attr 6=3" />
+  <set name="pz:limitmap:medium"  value="rpn:@attr 1=medium_exact @attr 6=3" />
+
+  <set name="full_text_target"  value="=NO" />
+  <set name="pz:termlist_term_count" value="10"/>
+
+  <set name="use_url_proxy"  value="0" />
+  <set name="pz:piggyback"   value="1" />
+  <set name="pz:preferred"   value="0" />
+  <set name="pz:block_timeout"  value="2" />
+  <set name="pz:cclmap:su"   value="1=subject" />
+  <set name="pz:sru"         value="solr"  />
+  <set name="use_thumbnails" value="0" />
+  <set name="pz:cclmap:issn"  value="u=8" />
+  <set name="pz:cclmap:ti"  value="1=title" />
+  <set name="pz:cclmap:au"  value="1=author" />
+  <set name="pz:cclmap:author_phrase" value="1=author_exact 6=3"/>
+  <set name="pz:xslt"  value="solr-pz2.xsl" />
+  <set name="pz:cclmap:term"  value="1=text s=Dal" />
+  <set name="pz:cclmap:isbn"  value="1=isbn" />
+  <set name="pz:queryencoding"  value="UTF-8" />
+
+</settings>
diff --git a/test/test_limit_limitmap_settings_3.xml b/test/test_limit_limitmap_settings_3.xml
new file mode 100644 (file)
index 0000000..bcd1e71
--- /dev/null
@@ -0,0 +1,4 @@
+<settings target="Target-1">
+  <set name="pz:limitmap:author"  value="rpn:@attr 1=1003 @attr 6=3" />
+  <set name="pz:limitmap:subject" value="rpn:@attr 1=21 @attr 6=3" />
+</settings>
diff --git a/test/test_limit_limitmap_settings_4.xml b/test/test_limit_limitmap_settings_4.xml
new file mode 100644 (file)
index 0000000..0d3528f
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<settings target="Target-1">
+  <set name="pz:limitmap:MySubject" value="local:subject" />
+</settings>
+
+
diff --git a/test/test_limit_limitmap_settings_5.xml b/test/test_limit_limitmap_settings_5.xml
new file mode 100644 (file)
index 0000000..02c965f
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<settings target="Target-2">
+  <set name="pz:limitmap:MySubject" value="local:subject" />
+</settings>
+