From: Dennis Schafroth Date: Tue, 25 Oct 2011 11:03:02 +0000 (+0200) Subject: Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/pazpar2 X-Git-Tag: v1.6.4~5 X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=commitdiff_plain;h=9fc82783ae2b4f497d7554bb7ed718729e2c683a;hp=4d09ef9c37fafb6bdb94cafb13c59e6ec11ae2f7;p=pazpar2-moved-to-github.git Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/pazpar2 --- diff --git a/NEWS b/NEWS index 142f08e..083d60a 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,15 @@ + +New pz:sortmap:field setting for specifying hints on how to make +a target natively sort on a field. This is used for command=show in +conjunction with sort. + +New pz:url setting for specifying the actual URL for a target. When +this is used the target ID is not used as URL anymore and the target ID +may be almost any string (not including []). + +command=termlist without name parameter returns all termlists/facets. +Previously if name parameter was omitted, only "subject" was returned. + --- 1.6.3 2011/09/22 Make termlist sorting stable. Terms with same frequency are now sorted by diff --git a/configure.ac b/configure.ac index 80ef5e8..500a801 100644 --- a/configure.ac +++ b/configure.ac @@ -22,7 +22,7 @@ AC_LANG(C) AC_C_INLINE -YAZ_INIT([static icu],[4.2.16]) +YAZ_INIT([static icu],[4.2.17]) if test -z "$YAZLIB"; then AC_MSG_ERROR([YAZ development libraries missing]) fi diff --git a/debian/control b/debian/control index 94cdd50..1e8ef4a 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,11 @@ Source: pazpar2 Section: net Priority: extra Maintainer: Adam Dickmeiss -Build-Depends: debhelper (>= 5), autotools-dev, libyaz4-dev (>= 4.2.0), docbook-xsl, libgnutls-dev +Build-Depends: debhelper (>= 5), + autotools-dev, + libyaz4-dev (>= 4.2.17), + docbook-xsl, + libgnutls-dev Standards-Version: 3.7.2 Package: pazpar2 diff --git a/doc/pazpar2_conf.xml b/doc/pazpar2_conf.xml index ef4cdb9..e558c65 100644 --- a/doc/pazpar2_conf.xml +++ b/doc/pazpar2_conf.xml @@ -750,6 +750,11 @@ multiple overlapping settings with the same name and target value, the 'precedence' attribute determines what happens. + + For Pazpar2 1.6.4 or later, the target ID may be user-defined, in + which case, the actual host, port, etc is given by setting + . + @@ -1233,9 +1238,45 @@ + + + pz:url + + + Specifies URL for the target and overrides the target ID. + + + + pz:url is only recognized for + Pazpar2 1.6.4 and later. + + + + + + + pz:sortmap:field + + + Specifies native sorting for a target where + field is a sort criteria (see command + show). The value has to components separated by colon: strategy and + native-field. Strategy is one of z3950, + type7, cql, + sru11, or embed. + The second component, native-field, is the field that is recognized + by the target. + + + + Only supported for Pazpar2 1.6.4 and later. + + + + - + diff --git a/doc/pazpar2_protocol.xml b/doc/pazpar2_protocol.xml index 80aed16..47314ac 100644 --- a/doc/pazpar2_protocol.xml +++ b/doc/pazpar2_protocol.xml @@ -188,13 +188,16 @@ search.pz?command=settings&session=2044502273&pz:allow[search.com:210/db1]=1 Limits the search to a given set of targets specified by the filter. The filter consists a comma separated list of - setting+operator+args pairs. The setting is a Pazpar2 setting + setting+operator+args + pairs. The setting is a Pazpar2 setting (such as pz:id). - The operator is either = (string match) - or ~ (substring match). The args is a list of values separated - by | (or , one of the values). The idea is that only targets - with a setting matching one of the values given will be included - in the search. + The operator is either + = (string match) + or ~ (substring match). + The args is a list of values separated + by | (or , one of the values). + The idea is that only targets with a setting matching one of + the values given will be included in the search. @@ -203,9 +206,14 @@ search.pz?command=settings&session=2044502273&pz:allow[search.com:210/db1]=1 Narrows the search by one or more fields (typically facets). - The limit is sequence of one or more name=value pairs separated - by comma. - A value that contains a comma should be escaped by backslash (\). + The limit is sequence of one or more + name=args pairs separated + by comma. The args is a list of values + separated by vertical bar (|). + The meaning of | is alternative, ie OR . + A value that contains a comma (,), + a vertical bar (|) or + backslash itself must be preceded by backslash (\). The pz:limitmap configuration item defines how the searches are mapped to a database. @@ -347,6 +355,11 @@ search.pz2?session=2044502273&command=stat in the pazpar2.cfg file, or the special names 'relevance' and 'position'. + + For targets where If pz:sortmap + is defined, a sort operation will be executed (possibly including + extending the search). + @@ -506,7 +519,8 @@ search.pz2?session=605047297&command=record&id=3 name - comma-separated list of termlist names (default "subject") + comma-separated list of termlist names. If omitted, + all termlists are returned. diff --git a/etc/cf.xsl b/etc/cf.xsl index 1c3c053..ec4615f 100644 --- a/etc/cf.xsl +++ b/etc/cf.xsl @@ -186,6 +186,12 @@ + + + + + + diff --git a/etc/default.xml b/etc/default.xml index 6dc9cae..5a9b299 100644 --- a/etc/default.xml +++ b/etc/default.xml @@ -1,7 +1,7 @@ - + diff --git a/pazpar2.spec b/pazpar2.spec index 998df6b..ec20f87 100644 --- a/pazpar2.spec +++ b/pazpar2.spec @@ -7,11 +7,11 @@ Group: Applications/Internet Vendor: Index Data ApS Source: pazpar2-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-root -BuildRequires: libyaz4-devel >= 4.2.0 +BuildRequires: libyaz4-devel >= 4.2.17 Packager: Adam Dickmeiss URL: http://www.indexdata.com/pazpar2 Summary: pazpar2 daemon -Requires: libyaz4 +Requires: libyaz4 >= 4.2.17 %description Pazpar2 is a high-performance, user interface-independent, data diff --git a/src/Makefile.am b/src/Makefile.am index 5d69f20..2f3643d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -22,7 +22,6 @@ libpazpar2_a_SOURCES = \ database.c database.h \ eventl.c eventl.h \ facet_limit.c facet_limit.h \ - getaddrinfo.c \ host.h \ http.c http.h http_command.c \ incref.c incref.h \ diff --git a/src/client.c b/src/client.c index 308364d..39190c0 100644 --- a/src/client.c +++ b/src/client.c @@ -119,8 +119,7 @@ struct client { ZOOM_resultset resultset; YAZ_MUTEX mutex; int ref_count; - /* copy of database->url */ - char *url; + char *id; }; struct show_raw { @@ -167,7 +166,8 @@ void client_set_state(struct client *cl, enum client_state st) { int no_active = session_active_clients(cl->session); - yaz_log(YLOG_DEBUG, "%s: releasing watches on zero active: %d", client_get_url(cl), no_active); + yaz_log(YLOG_DEBUG, "%s: releasing watches on zero active: %d", + client_get_id(cl), no_active); if (no_active == 0) { session_alert_watch(cl->session, SESSION_WATCH_SHOW); session_alert_watch(cl->session, SESSION_WATCH_SHOW_PREF); @@ -347,7 +347,7 @@ static void client_send_raw_present(struct client *cl) assert(set); yaz_log(YLOG_DEBUG, "%s: trying to present %d record(s) from %d", - client_get_url(cl), 1, offset); + client_get_id(cl), 1, offset); if (cl->show_raw->syntax) syntax = cl->show_raw->syntax; @@ -484,7 +484,7 @@ static void ingest_raw_record(struct client *cl, ZOOM_record rec) void client_check_preferred_watch(struct client *cl) { struct session *se = cl->session; - yaz_log(YLOG_DEBUG, "client_check_preferred_watch: %s ", client_get_url(cl)); + yaz_log(YLOG_DEBUG, "client_check_preferred_watch: %s ", client_get_id(cl)); if (se) { client_unlock(cl); @@ -498,14 +498,13 @@ void client_check_preferred_watch(struct client *cl) client_lock(cl); } else - yaz_log(YLOG_WARN, "client_check_preferred_watch: %s. No session!", client_get_url(cl)); + yaz_log(YLOG_WARN, "client_check_preferred_watch: %s. No session!", client_get_id(cl)); } void client_search_response(struct client *cl) { struct connection *co = cl->connection; - struct session *se = cl->session; ZOOM_connection link = connection_get_link(co); ZOOM_resultset resultset = cl->resultset; @@ -516,7 +515,7 @@ void client_search_response(struct client *cl) cl->hits = 0; client_set_state(cl, Client_Error); yaz_log(YLOG_WARN, "Search error %s (%s): %s", - error, addinfo, client_get_url(cl)); + error, addinfo, client_get_id(cl)); } else { @@ -525,11 +524,6 @@ void client_search_response(struct client *cl) client_report_facets(cl, resultset); cl->record_offset = cl->startrecs; cl->hits = ZOOM_resultset_size(resultset); - if (se) { - se->total_hits += cl->hits; - yaz_log(YLOG_DEBUG, "client_search_response: total hits " - ODR_INT_PRINTF, se->total_hits); - } } } @@ -556,7 +550,7 @@ void client_record_response(struct client *cl) { client_set_state(cl, Client_Error); yaz_log(YLOG_WARN, "Search error %s (%s): %s", - error, addinfo, client_get_url(cl)); + error, addinfo, client_get_id(cl)); } else { @@ -588,7 +582,7 @@ void client_record_response(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_url(cl), + msg, addinfo, client_get_id(cl), cl->record_offset); } else @@ -603,12 +597,12 @@ void client_record_response(struct client *cl) xmlrec = ZOOM_record_get(rec, type, NULL); if (!xmlrec) yaz_log(YLOG_WARN, "ZOOM_record_get failed from %s", - client_get_url(cl)); + client_get_id(cl)); else { /* OK = 0, -1 = failure, -2 = Filtered */ if (ingest_record(cl, xmlrec, cl->record_offset, nmem) == -1) - yaz_log(YLOG_WARN, "Failed to ingest from %s", client_get_url(cl)); + yaz_log(YLOG_WARN, "Failed to ingest from %s", client_get_id(cl)); } nmem_destroy(nmem); } @@ -665,13 +659,13 @@ int client_has_facet(struct client *cl, const char *name) return 0; } -void client_start_search(struct client *cl) +void client_start_search(struct client *cl, const char *sort_strategy_and_spec, + int increasing) { struct session_database *sdb = client_get_database(cl); struct connection *co = client_get_connection(cl); ZOOM_connection link = connection_get_link(co); ZOOM_resultset rs; - char *databaseName = sdb->database->databases[0]; const char *opt_piggyback = session_setting_oneval(sdb, PZ_PIGGYBACK); const char *opt_queryenc = session_setting_oneval(sdb, PZ_QUERYENCODING); const char *opt_elements = session_setting_oneval(sdb, PZ_ELEMENTS); @@ -682,10 +676,10 @@ void client_start_search(struct client *cl) 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]; + ZOOM_query q; assert(link); - cl->hits = -1; cl->record_offset = 0; cl->diagnostic = 0; @@ -695,7 +689,8 @@ void client_start_search(struct client *cl) if (opt_preferred) { cl->preferred = atoi(opt_preferred); if (cl->preferred) - yaz_log(YLOG_LOG, "Target %s has preferred status: %d", sdb->database->url, cl->preferred); + yaz_log(YLOG_LOG, "Target %s has preferred status: %d", + client_get_id(cl), cl->preferred); } client_set_state(cl, Client_Working); @@ -729,34 +724,52 @@ void client_start_search(struct client *cl) sprintf(startrecs_str, "%d", cl->startrecs); ZOOM_connection_option_set(link, "start", startrecs_str); - if (databaseName) - ZOOM_connection_option_set(link, "databaseName", databaseName); - /* TODO Verify does it break something for CQL targets(non-SOLR) ? */ /* facets definition is in PQF */ client_set_facets_request(cl, link); + q = ZOOM_query_create(); if (cl->cqlquery) { - ZOOM_query q = ZOOM_query_create(); - yaz_log(YLOG_LOG, "Search %s CQL: %s", sdb->database->url, cl->cqlquery); + yaz_log(YLOG_LOG, "Search %s CQL: %s", client_get_id(cl), + cl->cqlquery); ZOOM_query_cql(q, cl->cqlquery); if (*opt_sort) ZOOM_query_sortby(q, opt_sort); - rs = ZOOM_connection_search(link, q); - ZOOM_query_destroy(q); } else { - yaz_log(YLOG_LOG, "Search %s PQF: %s", sdb->database->url, cl->pquery); - rs = ZOOM_connection_search_pqf(link, cl->pquery); + yaz_log(YLOG_LOG, "Search %s PQF: %s", client_get_id(cl), cl->pquery); + + ZOOM_query_prefix(q, cl->pquery); + } + if (sort_strategy_and_spec && + strlen(sort_strategy_and_spec) < 40 /* spec below */) + { + char spec[50], *p; + strcpy(spec, sort_strategy_and_spec); + p = strchr(spec, ':'); + if (p) + { + *p++ = '\0'; /* cut the string in two */ + while (*p == ' ') + p++; + if (increasing) + strcat(p, " <"); + else + strcat(p, " >"); + yaz_log(YLOG_LOG, "applying %s %s", spec, p); + ZOOM_query_sortby2(q, spec, p); + } } + rs = ZOOM_connection_search(link, q); + ZOOM_query_destroy(q); ZOOM_resultset_destroy(cl->resultset); cl->resultset = rs; connection_continue(co); } -struct client *client_create(void) +struct client *client_create(const char *id) { struct client *cl = xmalloc(sizeof(*cl)); cl->maxrecs = 100; @@ -776,7 +789,8 @@ struct client *client_create(void) pazpar2_mutex_create(&cl->mutex, "client"); cl->preferred = 0; cl->ref_count = 1; - cl->url = 0; + assert(id); + cl->id = xstrdup(id); client_use(1); return cl; @@ -796,7 +810,7 @@ void client_incref(struct client *c) { pazpar2_incref(&c->ref_count, c->mutex); yaz_log(YLOG_DEBUG, "client_incref c=%p %s cnt=%d", - c, client_get_url(c), c->ref_count); + c, client_get_id(c), c->ref_count); } int client_destroy(struct client *c) @@ -804,14 +818,14 @@ int client_destroy(struct client *c) if (c) { yaz_log(YLOG_DEBUG, "client_destroy c=%p %s cnt=%d", - c, client_get_url(c), c->ref_count); + c, client_get_id(c), c->ref_count); if (!pazpar2_decref(&c->ref_count, c->mutex)) { xfree(c->pquery); c->pquery = 0; xfree(c->cqlquery); c->cqlquery = 0; - xfree(c->url); + xfree(c->id); assert(!c->connection); if (c->resultset) @@ -916,10 +930,14 @@ static char *make_solrquery(struct client *cl) ODR odr_out = odr_createmem(ODR_ENCODE); zquery = p_query_rpn(odr_out, cl->pquery); + if (zquery == 0) { + yaz_log(YLOG_WARN, "Failed to generate RPN from PQF: %s", cl->pquery); + return 0; + } yaz_log(YLOG_LOG, "PQF: %s", cl->pquery); if ((status = solr_transform_rpn2solr_wrbuf(sqlt, wrb, zquery))) { - yaz_log(YLOG_WARN, "Failed to generate SOLR query, code=%d", status); + yaz_log(YLOG_WARN, "Failed to generate SOLR query from PQF %s, code=%d", cl->pquery, status); r = 0; } else @@ -994,7 +1012,7 @@ static void apply_limit(struct session_database *sdb, if (!s) { yaz_log(YLOG_WARN, "Target %s: limit %s used, but no limitmap defined", - (sdb->database ? sdb->database->url : ""), name); + (sdb->database ? sdb->database->id : ""), name); } } nmem_destroy(nmem_tmp); @@ -1017,6 +1035,7 @@ int client_parse_query(struct client *cl, const char *query, if (!ccl_map) return -1; + cl->hits = -1; w_ccl = wrbuf_alloc(); wrbuf_puts(w_ccl, query); @@ -1037,7 +1056,7 @@ int client_parse_query(struct client *cl, const char *query, client_set_state(cl, Client_Error); session_log(se, YLOG_WARN, "Failed to parse CCL query '%s' for %s", wrbuf_cstr(w_ccl), - client_get_database(cl)->database->url); + client_get_id(cl)); wrbuf_destroy(w_ccl); wrbuf_destroy(w_pqf); return -1; @@ -1126,7 +1145,6 @@ int client_is_active_preferred(struct client *cl) return 0; } - Odr_int client_get_hits(struct client *cl) { return cl->hits; @@ -1150,24 +1168,11 @@ int client_get_diagnostic(struct client *cl) void client_set_database(struct client *cl, struct session_database *db) { cl->database = db; - /* Copy the URL for safe logging even after session is gone */ - if (db) { - cl->url = xstrdup(db->database->url); - } } -struct host *client_get_host(struct client *cl) +const char *client_get_id(struct client *cl) { - return client_get_database(cl)->database->host; -} - -const char *client_get_url(struct client *cl) -{ - if (cl->url) - return cl->url; - else - /* This must not happen anymore, as the url is present until destruction of client */ - return "NOURL"; + return cl->id; } void client_set_maxrecs(struct client *cl, int v) diff --git a/src/client.h b/src/client.h index fcb4c9c..2fb8ada 100644 --- a/src/client.h +++ b/src/client.h @@ -67,7 +67,7 @@ int client_is_our_response(struct client *cl); void client_continue(struct client *cl); -struct client *client_create(void); +struct client *client_create(const char *url); int client_destroy(struct client *c); void client_set_connection(struct client *cl, struct connection *con); @@ -76,7 +76,8 @@ int client_prep_connection(struct client *cl, int operation_timeout, int session_timeout, iochan_man_t iochan, const struct timeval *abstime); -void client_start_search(struct client *cl); +void client_start_search(struct client *cl, const char *sort_strategy_and_spec, + int increasing); void client_set_session(struct client *cl, struct session *se); int client_is_active(struct client *cl); int client_is_active_preferred(struct client *cl); @@ -89,8 +90,7 @@ int client_get_num_records(struct client *cl); int client_get_diagnostic(struct client *cl); void client_set_diagnostic(struct client *cl, int diagnostic); void client_set_database(struct client *cl, struct session_database *db); -struct host *client_get_host(struct client *cl); -const char *client_get_url(struct client *cl); +const char *client_get_id(struct client *cl); void client_set_maxrecs(struct client *cl, int v); int client_get_maxrecs(struct client *cl); void client_set_startrecs(struct client *cl, int v); diff --git a/src/connection.c b/src/connection.c index 0a6f61c..9381b53 100644 --- a/src/connection.c +++ b/src/connection.c @@ -166,12 +166,12 @@ static void connection_destroy(struct connection *co) // Creates a new connection for client, associated with the host of // client's database static struct connection *connection_create(struct client *cl, + struct host *host, int operation_timeout, int session_timeout, iochan_man_t iochan_man) { struct connection *co; - struct host *host = client_get_host(cl); co = xmalloc(sizeof(*co)); co->host = host; @@ -183,8 +183,8 @@ static struct connection *connection_create(struct client *cl, co->state = Conn_Resolving; co->operation_timeout = operation_timeout; co->session_timeout = session_timeout; - if (host->ipport) - connection_connect(co, iochan_man); + + connection_connect(co, iochan_man); yaz_mutex_enter(host->mutex); co->next = co->host->connections; @@ -223,7 +223,7 @@ static void non_block_events(struct connection *co) if ((err = ZOOM_connection_error(link, &error, &addinfo))) { yaz_log(YLOG_LOG, "Error %s from %s", - error, client_get_url(cl)); + error, client_get_id(cl)); client_set_diagnostic(cl, err); client_set_state(cl, Client_Error); } @@ -248,7 +248,7 @@ static void non_block_events(struct connection *co) case ZOOM_EVENT_RECV_APDU: break; case ZOOM_EVENT_CONNECT: - yaz_log(YLOG_LOG, "Connected to %s", client_get_url(cl)); + yaz_log(YLOG_LOG, "Connected to %s", client_get_id(cl)); co->state = Conn_Open; break; case ZOOM_EVENT_RECV_SEARCH: @@ -260,7 +260,7 @@ static void non_block_events(struct connection *co) break; default: yaz_log(YLOG_LOG, "Unhandled event (%d) from %s", - ev, client_get_url(cl)); + ev, client_get_id(cl)); } } if (got_records) @@ -305,7 +305,7 @@ static void connection_handler(IOCHAN iochan, int event) { if (co->state == Conn_Connecting) { - yaz_log(YLOG_WARN, "%p connect timeout %s", co, client_get_url(cl)); + yaz_log(YLOG_WARN, "%p connect timeout %s", co, client_get_id(cl)); client_set_state(cl, Client_Error); remove_connection_from_host(co); @@ -314,7 +314,7 @@ static void connection_handler(IOCHAN iochan, int event) } else { - yaz_log(YLOG_LOG, "%p Connection idle timeout %s", co, client_get_url(cl)); + yaz_log(YLOG_LOG, "%p Connection idle timeout %s", co, client_get_id(cl)); remove_connection_from_host(co); yaz_mutex_leave(host->mutex); connection_destroy(co); @@ -352,50 +352,6 @@ static void connection_release(struct connection *co) co->client = 0; } -void connect_resolver_host(struct host *host, iochan_man_t iochan_man) -{ - struct connection *con; - -start: - yaz_mutex_enter(host->mutex); - con = host->connections; - while (con) - { - if (con->state == Conn_Resolving) - { - if (!host->ipport) /* unresolved */ - { - remove_connection_from_host(con); - yaz_mutex_leave(host->mutex); - connection_destroy(con); - goto start; - /* start all over .. at some point it will be NULL */ - } - else if (!con->client) - { - remove_connection_from_host(con); - yaz_mutex_leave(host->mutex); - connection_destroy(con); - /* start all over .. at some point it will be NULL */ - goto start; - } - else - { - yaz_mutex_leave(host->mutex); - connection_connect(con, iochan_man); - client_start_search(con->client); - goto start; - } - } - else - { - yaz_log(YLOG_LOG, "connect_resolver_host: state=%d", con->state); - con = con->next; - } - } - yaz_mutex_leave(host->mutex); -} - static struct host *connection_get_host(struct connection *con) { return con->host; @@ -415,7 +371,6 @@ static int connection_connect(struct connection *con, iochan_man_t iochan_man) const char *zproxy = session_setting_oneval(sdb, PZ_ZPROXY); const char *apdulog = session_setting_oneval(sdb, PZ_APDULOG); - assert(host->ipport); assert(con); ZOOM_options_set(zoptions, "async", "1"); @@ -454,10 +409,10 @@ static int connection_connect(struct connection *con, iochan_man_t iochan_man) strcat(http_hostport, host->hostport); ZOOM_connection_connect(link, http_hostport, 0); } - else if (zproxy && *zproxy) - ZOOM_connection_connect(link, host->hostport, 0); else - ZOOM_connection_connect(link, host->ipport, 0); + { + ZOOM_connection_connect(link, host->hostport, 0); + } con->link = link; con->iochan = iochan_create(-1, connection_handler, 0, "connection_socket"); @@ -479,20 +434,37 @@ int client_prep_connection(struct client *cl, const struct timeval *abstime) { struct connection *co; - struct host *host = client_get_host(cl); struct session_database *sdb = client_get_database(cl); const char *zproxy = session_setting_oneval(sdb, PZ_ZPROXY); + const char *url = session_setting_oneval(sdb, PZ_URL); + struct host *host = 0; if (zproxy && zproxy[0] == '\0') zproxy = 0; - if (!host) - return 0; + if (!url || !*url) + url = sdb->database->id; - co = client_get_connection(cl); + host = find_host(client_get_session(cl)->service->server->database_hosts, + url); + + yaz_log(YLOG_DEBUG, "client_prep_connection: target=%s url=%s", + client_get_id(cl), url); - yaz_log(YLOG_DEBUG, "Client prep %s", client_get_url(cl)); + co = client_get_connection(cl); + if (co) + { + assert(co->host); + if (co->host == host) + ; /* reusing connection. It's ours! */ + else + { + client_incref(cl); + connection_release(co); + co = 0; + } + } if (!co) { int max_connections = 0; @@ -501,7 +473,7 @@ int client_prep_connection(struct client *cl, PZ_MAX_CONNECTIONS); if (v && *v) max_connections = atoi(v); - + v = session_setting_oneval(client_get_database(cl), PZ_REUSE_CONNECTIONS); if (v && *v) @@ -515,7 +487,8 @@ int client_prep_connection(struct client *cl, int num_connections = 0; for (co = host->connections; co; co = co->next) num_connections++; - if (reuse_connections) { + if (reuse_connections) + { for (co = host->connections; co; co = co->next) { if (connection_is_idle(co) && @@ -546,7 +519,7 @@ int client_prep_connection(struct client *cl, num_connections, max_connections); if (yaz_cond_wait(host->cond_ready, host->mutex, abstime)) { - yaz_log(YLOG_LOG, "out of connections %s", client_get_url(cl)); + yaz_log(YLOG_LOG, "out of connections %s", client_get_id(cl)); client_set_state(cl, Client_Error); yaz_mutex_leave(host->mutex); return 0; @@ -571,9 +544,10 @@ int client_prep_connection(struct client *cl, else { yaz_mutex_leave(host->mutex); - co = connection_create(cl, operation_timeout, session_timeout, + co = connection_create(cl, host, operation_timeout, session_timeout, iochan_man); } + assert(co->host); } if (co && co->link) diff --git a/src/database.c b/src/database.c index 08359d6..41e0f06 100644 --- a/src/database.c +++ b/src/database.c @@ -21,8 +21,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #endif -#include -#include #include #include #include @@ -38,15 +36,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "database.h" #include -#if HAVE_SYS_SOCKET_H -#include -#endif -#if HAVE_NETDB_H -#include -#endif -#if HAVE_NETINET_IN_H -#include -#endif enum pazpar2_database_criterion_type { PAZPAR2_STRING_MATCH, @@ -65,29 +54,25 @@ struct database_criterion { struct database_criterion *next; }; - struct database_hosts { struct host *hosts; YAZ_MUTEX mutex; }; // Create a new host structure for hostport -static struct host *create_host(const char *hostport, iochan_man_t iochan_man) +static struct host *create_host(const char *hostport) { struct host *host; + char *db_comment; host = xmalloc(sizeof(struct host)); host->hostport = xstrdup(hostport); + db_comment = strchr(host->hostport, '#'); + if (db_comment) + *db_comment = '\0'; host->connections = 0; - host->ipport = 0; host->mutex = 0; - if (host_getaddrinfo(host, iochan_man)) - { - xfree(host->hostport); - xfree(host); - return 0; - } pazpar2_mutex_create(&host->mutex, "host"); yaz_cond_create(&host->cond_ready); @@ -95,8 +80,7 @@ static struct host *create_host(const char *hostport, iochan_man_t iochan_man) return host; } -static struct host *find_host(database_hosts_t hosts, - const char *hostport, iochan_man_t iochan_man) +struct host *find_host(database_hosts_t hosts, const char *hostport) { struct host *p; yaz_mutex_enter(hosts->mutex); @@ -105,7 +89,7 @@ static struct host *find_host(database_hosts_t hosts, break; if (!p) { - p = create_host(hostport, iochan_man); + p = create_host(hostport); if (p) { p->next = hosts->hosts; @@ -116,97 +100,44 @@ static struct host *find_host(database_hosts_t hosts, return p; } -int resolve_database(struct conf_service *service, struct database *db) -{ - if (db->host == 0) - { - struct host *host; - char *p; - char hostport[256]; - strcpy(hostport, db->url); - if ((p = strchr(hostport, '/'))) - *p = '\0'; - if (!(host = find_host(service->server->database_hosts, - hostport, service->server->iochan_man))) - return -1; - db->host = host; - } - return 0; -} - -void resolve_databases(struct conf_service *service) -{ - struct database *db = service->databases; - for (; db; db = db->next) - resolve_database(service, db); -} - struct database *new_database(const char *id, NMEM nmem) { struct database *db; - char hostport[256]; - char *dbname; - char *db_comment; struct setting *idset; - if (strlen(id) > 255) - return 0; - strcpy(hostport, id); - if ((dbname = strchr(hostport, '/'))) - *(dbname++) = '\0'; - else - dbname = ""; - db_comment = strchr(dbname, '#'); - if (db_comment) - *db_comment = '\0'; db = nmem_malloc(nmem, sizeof(*db)); - memset(db, 0, sizeof(*db)); - db->host = 0; - db->url = nmem_strdup(nmem, id); - db->databases = nmem_malloc(nmem, 2 * sizeof(char *)); - db->databases[0] = nmem_strdup(nmem, dbname); - db->databases[1] = 0; - db->errors = 0; - db->explain = 0; - + 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); idset = nmem_malloc(nmem, sizeof(*idset)); idset->precedence = 0; idset->name = "pz:id"; - idset->target = idset->value = db->url; + idset->target = idset->value = db->id; idset->next = 0; db->settings[PZ_ID] = idset; - db->next = 0; - - return db; -} - -static struct database *load_database(const char *id, - struct conf_service *service) -{ - struct database *db; - struct zr_explain *explain = 0; - - db = new_database(id, service->nmem); - db->explain = explain; - db->next = service->databases; - service->databases = db; return db; } // Return a database structure by ID. Load and add to list if necessary // new==1 just means we know it's not in the list -struct database *find_database(const char *id, struct conf_service *service) +struct database *create_database_for_service(const char *id, + struct conf_service *service) { struct database *p; for (p = service->databases; p; p = p->next) - if (!strcmp(p->url, id)) + if (!strcmp(p->id, id)) return p; - return load_database(id, service); + + p = new_database(id, service->nmem); + + p->next = service->databases; + service->databases = p; + + return p; } // This whole session_grep database thing should be moved elsewhere @@ -344,7 +275,7 @@ static int database_match_criteria(struct setting **settings, // Cycles through databases, calling a handler function on the ones for // which all criteria matched. int session_grep_databases(struct session *se, const char *filter, - void (*fun)(void *context, struct session_database *db)) + void (*fun)(struct session *se, struct session_database *db)) { struct session_database *p; NMEM nmem = nmem_create(); @@ -401,7 +332,6 @@ void database_hosts_destroy(database_hosts_t *pp) struct host *p_next = p->next; yaz_mutex_destroy(&p->mutex); yaz_cond_destroy(&p->cond_ready); - xfree(p->ipport); xfree(p->hostport); xfree(p); p = p_next; diff --git a/src/database.h b/src/database.h index 22df499..1394732 100644 --- a/src/database.h +++ b/src/database.h @@ -24,15 +24,18 @@ typedef struct database_hosts *database_hosts_t; struct session_database; struct session; struct conf_service; -struct database *find_database(const char *id, struct conf_service *service); +struct database *create_database_for_service(const char *id, + struct conf_service *service); int session_grep_databases(struct session *se, const char *filter, - void (*fun)(void *context, struct session_database *db)); + void (*fun)(struct session *se, struct session_database *db)); 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); -int resolve_database(struct conf_service *service, struct database *db); struct database *new_database(const char *id, NMEM nmem); database_hosts_t database_hosts_create(void); void database_hosts_destroy(database_hosts_t *); + +struct host *find_host(database_hosts_t hosts, const char *hostport); + #endif diff --git a/src/getaddrinfo.c b/src/getaddrinfo.c deleted file mode 100644 index 52a489f..0000000 --- a/src/getaddrinfo.c +++ /dev/null @@ -1,227 +0,0 @@ -/* This file is part of Pazpar2. - Copyright (C) 2006-2011 Index Data - -Pazpar2 is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later -version. - -Pazpar2 is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -*/ - -#if HAVE_CONFIG_H -#include -#endif - -#include "sel_thread.h" - -#if HAVE_UNISTD_H -#include -#endif -#include - -#include -#include -#if HAVE_SYS_SOCKET_H -#include -#endif -#ifdef WIN32 -#include -#endif -#if HAVE_NETDB_H -#include -#endif -#if HAVE_NETINET_IN_H -#include -#endif - -#include -#include -#include - -#include "session.h" -#include "connection.h" -#include "host.h" - -/* Only use a threaded resolver on Unix that offers getaddrinfo. - gethostbyname is NOT reentrant. - */ -#if HAVE_GETADDRINFO -#ifndef WIN32 -#define USE_THREADED_RESOLVER 1 -#endif -#endif - -struct work { - char *hostport; /* hostport to be resolved in separate thread */ - char *ipport; /* result or NULL if it could not be resolved */ - struct host *host; /* host that we're dealing with - mother thread */ - iochan_man_t iochan_man; /* iochan manager */ -}; - -static int log_level = YLOG_LOG; - -void perform_getaddrinfo(struct work *w) -{ - int res = 0; - char *port; -#if HAVE_GETADDRINFO - struct addrinfo *addrinfo, hints; -#else - struct hostent *hp; -#endif - char *hostport = xstrdup(w->hostport); - - if ((port = strchr(hostport, ':'))) - *(port++) = '\0'; - else - port = "210"; - -#if HAVE_GETADDRINFO - hints.ai_flags = 0; - hints.ai_family = PF_INET; - hints.ai_socktype = SOCK_STREAM; - hints.ai_protocol = IPPROTO_TCP; - hints.ai_addrlen = 0; - hints.ai_addr = 0; - hints.ai_canonname = 0; - hints.ai_next = 0; - // This is not robust code. It assumes that getaddrinfo always - // returns AF_INET address. - if ((res = getaddrinfo(hostport, port, &hints, &addrinfo))) - { - yaz_log(YLOG_WARN, "Failed to resolve %s: %s", - w->hostport, gai_strerror(res)); - } - else - { - char ipport[128]; - unsigned char addrbuf[4]; - assert(addrinfo->ai_family == PF_INET); - memcpy(addrbuf, - &((struct sockaddr_in*)addrinfo->ai_addr)->sin_addr.s_addr, 4); - sprintf(ipport, "%u.%u.%u.%u:%s", - addrbuf[0], addrbuf[1], addrbuf[2], addrbuf[3], port); - freeaddrinfo(addrinfo); - w->ipport = xstrdup(ipport); - yaz_log(log_level, "Resolved %s -> %s", hostport, ipport); - } -#else - hp = gethostbyname(hostport); - if (!hp) - { - yaz_log(YLOG_WARN|YLOG_ERRNO, "Failed to resolve %s", hostport); - } - else - { - char ipport[128]; - unsigned char addrbuf[4]; - - memcpy(addrbuf, *hp->h_addr_list, 4 * sizeof(unsigned char)); - sprintf(ipport, "%u.%u.%u.%u:%s", - addrbuf[0], addrbuf[1], addrbuf[2], addrbuf[3], port); - w->ipport = xstrdup(ipport); - yaz_log(log_level, "Resolved %s -> %s", hostport, ipport); - } -#endif - xfree(hostport); -} - -static void work_handler(void *vp) -{ - struct work *w = vp; - - int sec = 0; /* >0 for debugging/testing purposes */ - if (sec) - { - yaz_log(log_level, "waiting %d seconds", sec); -#if HAVE_UNISTD_H - sleep(sec); -#endif - } - perform_getaddrinfo(w); -} - -#if USE_THREADED_RESOLVER -void iochan_handler(struct iochan *i, int event) -{ - sel_thread_t p = iochan_getdata(i); - - if (event & EVENT_INPUT) - { - struct work *w = sel_thread_result(p); - w->host->ipport = w->ipport; - connect_resolver_host(w->host, w->iochan_man); - xfree(w); - } -} - -static sel_thread_t resolver_thread = 0; - -static void getaddrinfo_start(iochan_man_t iochan_man) -{ - int fd; - sel_thread_t p = resolver_thread = - sel_thread_create(work_handler, 0 /* work_destroy */, &fd, - 3 /* no of resolver threads */); - if (!p) - { - yaz_log(YLOG_FATAL|YLOG_ERRNO, "sel_create_create failed"); - exit(1); - } - else - { - IOCHAN chan = iochan_create(fd, iochan_handler, EVENT_INPUT, - "getaddrinfo_socket"); - iochan_setdata(chan, p); - iochan_add(iochan_man, chan); - } - yaz_log(log_level, "resolver start"); - resolver_thread = p; -} -#endif - -int host_getaddrinfo(struct host *host, iochan_man_t iochan_man) -{ - struct work *w = xmalloc(sizeof(*w)); - int use_thread = 0; /* =0 to disable threading entirely */ - - w->hostport = host->hostport; - w->ipport = 0; - w->host = host; - w->iochan_man = iochan_man; -#if USE_THREADED_RESOLVER - if (use_thread) - { - if (resolver_thread == 0) - getaddrinfo_start(iochan_man); - assert(resolver_thread); - sel_thread_add(resolver_thread, w); - return 0; - } -#endif - perform_getaddrinfo(w); - host->ipport = w->ipport; - xfree(w); - if (!host->ipport) - return -1; - return 0; -} - -/* - * Local variables: - * c-basic-offset: 4 - * c-file-style: "Stroustrup" - * indent-tabs-mode: nil - * End: - * vim: shiftwidth=4 tabstop=8 expandtab - */ - diff --git a/src/host.h b/src/host.h index 4ab7fe8..752ca09 100644 --- a/src/host.h +++ b/src/host.h @@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA /** \brief Represents a host (irrespective of databases) */ struct host { char *hostport; - char *ipport; struct connection *connections; // All connections to this struct host *next; YAZ_MUTEX mutex; diff --git a/src/http.c b/src/http.c index c9cca1d..ef88f17 100644 --- a/src/http.c +++ b/src/http.c @@ -889,7 +889,7 @@ static void http_io(IOCHAN i, int event) { struct timeval tv; gettimeofday(&tv, 0); - fprintf(hc->http_server->record_file, "%lld %lld %lld 0\n", + fprintf(hc->http_server->record_file, "r %lld %lld %lld 0\n", (long long) tv.tv_sec, (long long) tv.tv_usec, (long long) iochan_getfd(i)); } @@ -921,11 +921,12 @@ static void http_io(IOCHAN i, int event) for (hb = hc->iqueue; hb; hb = hb->next) sz += hb->len; gettimeofday(&tv, 0); - fprintf(hc->http_server->record_file, "%lld %lld %lld %d\n", + fprintf(hc->http_server->record_file, "r %lld %lld %lld %d\n", (long long) tv.tv_sec, (long long) tv.tv_usec, (long long) iochan_getfd(i), sz); for (hb = hc->iqueue; hb; hb = hb->next) fwrite(hb->buf, 1, hb->len, hc->http_server->record_file); + fflush(hc->http_server->record_file); } #endif if (!(hc->request = http_parse_request(hc, &hc->iqueue, reqlen))) @@ -968,6 +969,21 @@ static void http_io(IOCHAN i, int event) } if (res == wb->len) { +#if HAVE_SYS_TIME_H + if (hc->http_server->record_file) + { + struct timeval tv; + int sz = wb->offset + wb->len; + gettimeofday(&tv, 0); + fprintf(hc->http_server->record_file, "w %lld %lld %lld %d\n", + (long long) tv.tv_sec, (long long) tv.tv_usec, + (long long) iochan_getfd(i), sz); + fwrite(wb->buf, 1, wb->offset + wb->len, + hc->http_server->record_file); + fputc('\n', hc->http_server->record_file); + fflush(hc->http_server->record_file); + } + #endif hc->oqueue = hc->oqueue->next; http_buf_destroy(hc->http_server, wb); } diff --git a/src/http_command.c b/src/http_command.c index b46ba7b..963740f 100644 --- a/src/http_command.c +++ b/src/http_command.c @@ -267,6 +267,28 @@ static void error(struct http_response *rs, http_send_response(c); } +static void response_open_no_status(struct http_channel *c, const char *command) +{ + wrbuf_rewind(c->wrbuf); + wrbuf_printf(c->wrbuf, "%s<%s>", + HTTP_COMMAND_RESPONSE_PREFIX, command); +} + +static void response_open(struct http_channel *c, const char *command) +{ + response_open_no_status(c, command); + wrbuf_puts(c->wrbuf, "OK"); +} + +static void response_close(struct http_channel *c, const char *command) +{ + struct http_response *rs = c->response; + + wrbuf_printf(c->wrbuf, "", command); + rs->payload = nmem_strdup(c->nmem, wrbuf_cstr(c->wrbuf)); + http_send_response(c); +} + unsigned int make_sessionid(void) { static int seq = 0; /* thread pr */ @@ -368,18 +390,15 @@ static int process_settings(struct session *se, struct http_request *rq, static void cmd_exit(struct http_channel *c) { - char buf[1024]; - struct http_response *rs = c->response; yaz_log(YLOG_WARN, "exit"); - sprintf(buf, HTTP_COMMAND_RESPONSE_PREFIX "OK"); - rs->payload = nmem_strdup(c->nmem, buf); - http_send_response(c); + + response_open(c, "exit"); + response_close(c, "exit"); http_close_server(c->server); } static void cmd_init(struct http_channel *c) { - char buf[1024]; struct http_request *r = c->request; const char *clear = http_argbyname(r, "clear"); const char *content_type = http_lookup_header(r->headers, "Content-Type"); @@ -429,18 +448,18 @@ static void cmd_init(struct http_channel *c) if (process_settings(s->psession, c->request, c->response) < 0) return; - - sprintf(buf, HTTP_COMMAND_RESPONSE_PREFIX - "OK%d", sesid); + + response_open(c, "init"); + wrbuf_printf(c->wrbuf, "%d", sesid); if (c->server->server_id) { - strcat(buf, "."); - strcat(buf, c->server->server_id); + wrbuf_puts(c->wrbuf, "."); + wrbuf_puts(c->wrbuf, c->server->server_id); } - strcat(buf, "" - "" PAZPAR2_PROTOCOL_VERSION ""); - rs->payload = nmem_strdup(c->nmem, buf); - http_send_response(c); + wrbuf_puts(c->wrbuf, "" + "" PAZPAR2_PROTOCOL_VERSION ""); + + response_close(c, "init"); } static void apply_local_setting(void *client_data, @@ -484,144 +503,34 @@ static void cmd_settings(struct http_channel *c) release_session(c, s); return; } - rs->payload = HTTP_COMMAND_RESPONSE_PREFIX "OK"; - http_send_response(c); + response_open(c, "settings"); + response_close(c, "settings"); release_session(c, s); } -// Compares two hitsbytarget nodes by hitcount -static int cmp_ht(const void *p1, const void *p2) -{ - const struct hitsbytarget *h1 = p1; - const struct hitsbytarget *h2 = p2; - return h2->hits - h1->hits; -} - -// This implements functionality somewhat similar to 'bytarget', but in a termlist form -static int targets_termlist(WRBUF wrbuf, struct session *se, int num, - NMEM nmem) -{ - struct hitsbytarget *ht; - int count, i; - - ht = hitsbytarget(se, &count, nmem); - qsort(ht, count, sizeof(struct hitsbytarget), cmp_ht); - for (i = 0; i < count && i < num && ht[i].hits > 0; i++) - { - - // do only print terms which have display names - - wrbuf_puts(wrbuf, "\n"); - - wrbuf_puts(wrbuf, ""); - wrbuf_xmlputs(wrbuf, ht[i].id); - wrbuf_puts(wrbuf, "\n"); - - wrbuf_puts(wrbuf, ""); - if (!ht[i].name || !ht[i].name[0]) - wrbuf_xmlputs(wrbuf, "NO TARGET NAME"); - else - wrbuf_xmlputs(wrbuf, ht[i].name); - wrbuf_puts(wrbuf, "\n"); - - wrbuf_printf(wrbuf, "" ODR_INT_PRINTF "\n", - ht[i].hits); - - wrbuf_puts(wrbuf, ""); - wrbuf_xmlputs(wrbuf, ht[i].state); - wrbuf_puts(wrbuf, "\n"); - - wrbuf_printf(wrbuf, "%d\n", - ht[i].diagnostic); - wrbuf_puts(wrbuf, "\n"); - } - return count; -} - static void cmd_termlist(struct http_channel *c) { - struct http_response *rs = c->response; struct http_request *rq = c->request; struct http_session *s = locate_session(c); const char *name = http_argbyname(rq, "name"); const char *nums = http_argbyname(rq, "num"); int num = 15; int status; - WRBUF debug_log = 0; if (!s) return; status = session_active_clients(s->psession); - if (!name) - name = "subject"; - if (strlen(name) > 255) - return; if (nums) num = atoi(nums); - debug_log = wrbuf_alloc(); + response_open_no_status(c, "termlist"); + wrbuf_printf(c->wrbuf, "%d\n", status); - wrbuf_rewind(c->wrbuf); + perform_termlist(c, s->psession, name, num); - wrbuf_puts(c->wrbuf, "\n"); - wrbuf_printf(c->wrbuf, "%d\n", status); - while (*name) - { - char tname[256]; - const char *tp; - - if (!(tp = strchr(name, ','))) - tp = name + strlen(name); - strncpy(tname, name, tp - name); - tname[tp - name] = '\0'; - wrbuf_puts(c->wrbuf, "wrbuf, tname); - wrbuf_puts(c->wrbuf, "\">\n"); - if (!strcmp(tname, "xtargets")) - { - int targets = targets_termlist(c->wrbuf, s->psession, num, c->nmem); - wrbuf_printf(debug_log, " xtargets: %d", targets); - } - else - { - int len; - struct termlist_score **p = - get_termlist_score(s->psession, tname, &len); - if (p && len) - wrbuf_printf(debug_log, " %s: %d", tname, len); - if (p) - { - int i; - for (i = 0; i < len && i < num; i++) - { - // prevnt sending empty term elements - if (!p[i]->display_term || !p[i]->display_term[0]) - continue; - - wrbuf_puts(c->wrbuf, ""); - wrbuf_puts(c->wrbuf, ""); - wrbuf_xmlputs(c->wrbuf, p[i]->display_term); - wrbuf_puts(c->wrbuf, ""); - - wrbuf_printf(c->wrbuf, - "%d", - p[i]->frequency); - wrbuf_puts(c->wrbuf, "\n"); - } - } - } - wrbuf_puts(c->wrbuf, "\n"); - name = tp; - if (*name == ',') - name++; - } - wrbuf_puts(c->wrbuf, "\n"); - yaz_log(YLOG_DEBUG, "termlist response: %s ", wrbuf_cstr(debug_log)); - wrbuf_destroy(debug_log); - rs->payload = nmem_strdup(rq->channel->nmem, wrbuf_cstr(c->wrbuf)); - http_send_response(c); + response_close(c, "termlist"); release_session(c, s); } @@ -638,19 +547,14 @@ static void session_status(struct http_channel *c, struct http_session *s) static void cmd_session_status(struct http_channel *c) { - struct http_response *rs = c->response; struct http_session *s = locate_session(c); if (!s) return; - wrbuf_rewind(c->wrbuf); - wrbuf_puts(c->wrbuf, HTTP_COMMAND_RESPONSE_PREFIX "OK\n"); + response_open(c, "session-status"); session_status(c, s); - wrbuf_puts(c->wrbuf, "\n"); - rs->payload = nmem_strdup(c->nmem, wrbuf_cstr(c->wrbuf)); - http_send_response(c); + response_close(c, "session-status"); release_session(c, s); - } int sessions_count(void); @@ -663,13 +567,12 @@ int resultsets_count(void); static void cmd_server_status(struct http_channel *c) { - struct http_response *rs = c->response; int sessions = sessions_count(); int clients = clients_count(); int resultsets = resultsets_count(); - wrbuf_rewind(c->wrbuf); - wrbuf_puts(c->wrbuf, HTTP_COMMAND_RESPONSE_PREFIX "\n"); - wrbuf_printf(c->wrbuf, " %u\n", sessions); + + response_open(c, "server-status"); + wrbuf_printf(c->wrbuf, "\n %u\n", sessions); wrbuf_printf(c->wrbuf, " %u\n", clients); /* Only works if yaz has been compiled with enabling of this */ wrbuf_printf(c->wrbuf, " %u\n",resultsets); @@ -693,16 +596,13 @@ static void cmd_server_status(struct http_channel *c) } yaz_mutex_leave(http_sessions->mutex); */ - wrbuf_puts(c->wrbuf, "\n"); - rs->payload = nmem_strdup(c->nmem, wrbuf_cstr(c->wrbuf)); - http_send_response(c); + response_close(c, "server-status"); xmalloc_trav(0); } static void cmd_bytarget(struct http_channel *c) { - struct http_response *rs = c->response; struct http_request *rq = c->request; struct http_session *s = locate_session(c); struct hitsbytarget *ht; @@ -711,9 +611,8 @@ static void cmd_bytarget(struct http_channel *c) if (!s) return; - ht = hitsbytarget(s->psession, &count, c->nmem); - wrbuf_rewind(c->wrbuf); - wrbuf_puts(c->wrbuf, HTTP_COMMAND_RESPONSE_PREFIX "OK"); + ht = get_hitsbytarget(s->psession, &count, c->nmem); + response_open(c, "bytarget"); for (i = 0; i < count; i++) { @@ -745,10 +644,7 @@ static void cmd_bytarget(struct http_channel *c) } wrbuf_puts(c->wrbuf, ""); } - - wrbuf_puts(c->wrbuf, ""); - rs->payload = nmem_strdup(c->nmem, wrbuf_cstr(c->wrbuf)); - http_send_response(c); + response_close(c, "bytarget"); release_session(c, s); } @@ -800,7 +696,7 @@ static void write_subrecord(struct record *r, WRBUF w, client_get_database(r->client), PZ_NAME); wrbuf_puts(w, "client)->database->url); + wrbuf_xmlputs(w, client_get_id(r->client)); wrbuf_puts(w, "\" "); wrbuf_puts(w, "name=\""); @@ -934,8 +830,8 @@ static void cmd_record(struct http_channel *c) } else { - wrbuf_puts(c->wrbuf, HTTP_COMMAND_RESPONSE_PREFIX "\n"); - wrbuf_puts(c->wrbuf, ""); + response_open_no_status(c, "record"); + wrbuf_puts(c->wrbuf, "\n"); wrbuf_xmlputs(c->wrbuf, rec->recid); wrbuf_puts(c->wrbuf, "\n"); if (prev_r) @@ -955,9 +851,7 @@ static void cmd_record(struct http_channel *c) write_metadata(c->wrbuf, service, rec->metadata, 1); for (r = rec->records; r; r = r->next) write_subrecord(r, c->wrbuf, service, 1); - wrbuf_puts(c->wrbuf, "\n"); - rs->payload = nmem_strdup(c->nmem, wrbuf_cstr(c->wrbuf)); - http_send_response(c); + response_close(c, "record"); } show_single_stop(s->psession, rec); release_session(c, s); @@ -1004,14 +898,14 @@ static void show_records(struct http_channel *c, int active) error(rs, PAZPAR2_MALFORMED_PARAMETER_VALUE, "sort"); release_session(c, s); return; + } rl = show_range_start(s->psession, sp, startn, &numn, &total, &total_hits); - wrbuf_rewind(c->wrbuf); - wrbuf_puts(c->wrbuf, HTTP_COMMAND_RESPONSE_PREFIX "\nOK\n"); - wrbuf_printf(c->wrbuf, "%d\n", active); + response_open(c, "show"); + wrbuf_printf(c->wrbuf, "\n%d\n", active); wrbuf_printf(c->wrbuf, "%d\n", total); wrbuf_printf(c->wrbuf, "" ODR_INT_PRINTF "\n", total_hits); wrbuf_printf(c->wrbuf, "%d\n", startn); @@ -1041,9 +935,7 @@ static void show_records(struct http_channel *c, int active) show_range_stop(s->psession, rl); - wrbuf_puts(c->wrbuf, "\n"); - rs->payload = nmem_strdup(c->nmem, wrbuf_cstr(c->wrbuf)); - http_send_response(c); + response_close(c, "show"); release_session(c, s); } @@ -1059,11 +951,24 @@ static void cmd_show(struct http_channel *c) struct http_request *rq = c->request; struct http_session *s = locate_session(c); const char *block = http_argbyname(rq, "block"); + const char *sort = http_argbyname(rq, "sort"); + struct reclist_sortparms *sp; int status; if (!s) return; + if (!sort) + sort = "relevance"; + + if (!(sp = reclist_parse_sortparms(c->nmem, sort, s->psession->service))) + { + error(c->response, PAZPAR2_MALFORMED_PARAMETER_VALUE, "sort"); + release_session(c, s); + return; + } + session_sort(s->psession, sp->name, sp->increasing); + status = session_active_clients(s->psession); if (block) @@ -1081,7 +986,7 @@ static void cmd_show(struct http_channel *c) return; } - else if (status && reclist_get_num_records(s->psession->reclist) == 0) + else if (status) { // if there is already a watch/block. we do not block this one if (session_set_watch(s->psession, SESSION_WATCH_SHOW, @@ -1099,12 +1004,11 @@ static void cmd_show(struct http_channel *c) static void cmd_ping(struct http_channel *c) { - struct http_response *rs = c->response; struct http_session *s = locate_session(c); if (!s) return; - rs->payload = HTTP_COMMAND_RESPONSE_PREFIX "OK"; - http_send_response(c); + response_open(c, "ping"); + response_close(c, "ping"); release_session(c, s); } @@ -1135,23 +1039,22 @@ static void cmd_search(struct http_channel *c) release_session(c, s); return; } - code = search(s->psession, query, startrecs, maxrecs, filter, limit, - &addinfo); + code = session_search(s->psession, query, startrecs, maxrecs, filter, limit, + &addinfo, "relevance", 0); if (code) { error(rs, code, addinfo); release_session(c, s); return; } - rs->payload = HTTP_COMMAND_RESPONSE_PREFIX "OK"; - http_send_response(c); + response_open(c, "search"); + response_close(c, "search"); release_session(c, s); } static void cmd_stat(struct http_channel *c) { - struct http_response *rs = c->response; struct http_session *s = locate_session(c); struct statistics stat; int clients; @@ -1169,8 +1072,7 @@ static void cmd_stat(struct http_channel *c) progress = (stat.num_clients - clients) / (float)stat.num_clients; } - wrbuf_rewind(c->wrbuf); - wrbuf_puts(c->wrbuf, HTTP_COMMAND_RESPONSE_PREFIX ""); + response_open_no_status(c, "stat"); wrbuf_printf(c->wrbuf, "%d\n", clients); wrbuf_printf(c->wrbuf, "" ODR_INT_PRINTF "\n", stat.num_hits); wrbuf_printf(c->wrbuf, "%d\n", stat.num_records); @@ -1182,19 +1084,15 @@ static void cmd_stat(struct http_channel *c) wrbuf_printf(c->wrbuf, "%d\n", stat.num_failed); wrbuf_printf(c->wrbuf, "%d\n", stat.num_error); wrbuf_printf(c->wrbuf, "%.2f\n", progress); - wrbuf_puts(c->wrbuf, ""); - rs->payload = nmem_strdup(c->nmem, wrbuf_cstr(c->wrbuf)); - http_send_response(c); + response_close(c, "stat"); release_session(c, s); } static void cmd_info(struct http_channel *c) { char yaz_version_str[20]; - struct http_response *rs = c->response; - wrbuf_rewind(c->wrbuf); - wrbuf_puts(c->wrbuf, HTTP_COMMAND_RESPONSE_PREFIX "\n"); + response_open_no_status(c, "info"); wrbuf_puts(c->wrbuf, " \n"); wrbuf_puts(c->wrbuf, " wrbuf, VERSION); wrbuf_puts(c->wrbuf, ""); - yaz_version(yaz_version_str, 0); wrbuf_puts(c->wrbuf, " wrbuf, YAZ_VERSION); @@ -1216,9 +1113,7 @@ static void cmd_info(struct http_channel *c) info_services(c->server, c->wrbuf); - wrbuf_puts(c->wrbuf, ""); - rs->payload = nmem_strdup(c->nmem, wrbuf_cstr(c->wrbuf)); - http_send_response(c); + response_close(c, "info"); } struct { diff --git a/src/pazpar2.c b/src/pazpar2.c index f51fa9e..585c0f8 100644 --- a/src/pazpar2.c +++ b/src/pazpar2.c @@ -23,6 +23,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #ifdef WIN32 #include #endif +#if HAVE_UNISTD_H +#include +#endif #include #include diff --git a/src/pazpar2_config.c b/src/pazpar2_config.c index b766b7f..c6567bd 100644 --- a/src/pazpar2_config.c +++ b/src/pazpar2_config.c @@ -56,10 +56,6 @@ struct conf_config database_hosts_t database_hosts; }; - -static char *parse_settings(struct conf_config *config, - NMEM nmem, xmlNode *node); - static void conf_metadata_assign(NMEM nmem, struct conf_metadata * metadata, const char *name, @@ -106,7 +102,6 @@ static void conf_sortkey_assign(NMEM nmem, sortkey->type = type; } - static struct conf_service *service_init(struct conf_server *server, int num_metadata, int num_sortkeys, const char *service_id) @@ -119,7 +114,6 @@ static struct conf_service *service_init(struct conf_server *server, service->ref_count = 1; service->nmem = nmem; service->next = 0; - service->settings = 0; service->databases = 0; service->server = server; service->session_timeout = 60; /* default session timeout */ @@ -132,9 +126,9 @@ static struct conf_service *service_init(struct conf_server *server, service->num_metadata = num_metadata; service->metadata = 0; if (service->num_metadata) - service->metadata - = nmem_malloc(nmem, - sizeof(struct conf_metadata) * service->num_metadata); + service->metadata + = nmem_malloc(nmem, + sizeof(struct conf_metadata) * service->num_metadata); service->num_sortkeys = num_sortkeys; service->sortkeys = 0; if (service->num_sortkeys) @@ -172,7 +166,6 @@ static struct conf_metadata* conf_service_add_metadata( return md; } - static struct conf_sortkey * conf_service_add_sortkey( struct conf_service *service, int field_id, @@ -182,7 +175,7 @@ static struct conf_sortkey * conf_service_add_sortkey( struct conf_sortkey * sk = 0; if (!service || !service->sortkeys || !service->num_sortkeys - || field_id < 0 || !(field_id < service->num_sortkeys)) + || field_id < 0 || !(field_id < service->num_sortkeys)) return 0; //sk = &((service->sortkeys)[field_id]); @@ -192,7 +185,6 @@ static struct conf_sortkey * conf_service_add_sortkey( return sk; } - int conf_service_metadata_field_id(struct conf_service *service, const char * name) { @@ -200,16 +192,13 @@ int conf_service_metadata_field_id(struct conf_service *service, if (!service || !service->metadata || !service->num_metadata) return -1; - - for(i = 0; i < service->num_metadata; i++) { + + for (i = 0; i < service->num_metadata; i++) if (!strcmp(name, (service->metadata[i]).name)) return i; - } - return -1; } - int conf_service_sortkey_field_id(struct conf_service *service, const char * name) { @@ -218,11 +207,9 @@ int conf_service_sortkey_field_id(struct conf_service *service, if (!service || !service->sortkeys || !service->num_sortkeys) return -1; - for(i = 0; i < service->num_sortkeys; i++) { + for (i = 0; i < service->num_sortkeys; i++) if (!strcmp(name, (service->sortkeys[i]).name)) return i; - } - return -1; } @@ -594,39 +581,17 @@ static struct conf_service *service_create_static(struct conf_server *server, return service; } -static char *parse_settings(struct conf_config *config, - NMEM nmem, xmlNode *node) -{ - xmlChar *src = xmlGetProp(node, (xmlChar *) "src"); - char *r; - - if (src) - { - WRBUF w = wrbuf_alloc(); - conf_dir_path(config, w, (const char *) src); - r = nmem_strdup(nmem, wrbuf_cstr(w)); - wrbuf_destroy(w); - } - else - { - yaz_log(YLOG_FATAL, "Must specify src in targetprofile"); - return 0; - } - xmlFree(src); - return r; -} - static void inherit_server_settings(struct conf_service *s) { struct conf_server *server = s->server; if (!s->dictionary) /* service has no config settings ? */ { - if (server->server_settings) + if (server->settings_fname) { /* inherit settings from server */ init_settings(s); - settings_read_file(s, server->server_settings, 1); - settings_read_file(s, server->server_settings, 2); + settings_read_file(s, server->settings_fname, 1); + settings_read_file(s, server->settings_fname, 2); } else { @@ -660,7 +625,6 @@ struct conf_service *service_create(struct conf_server *server, if (service) { inherit_server_settings(service); - resolve_databases(service); assert(service->mutex == 0); pazpar2_mutex_create(&service->mutex, "conf"); } @@ -683,10 +647,10 @@ static struct conf_server *server_create(struct conf_config *config, server->config = config; server->next = 0; server->charsets = 0; - server->server_settings = 0; server->http_server = 0; server->iochan_man = 0; - server->database_hosts = 0; + server->database_hosts = config->database_hosts; + server->settings_fname = 0; if (server_id) { @@ -727,13 +691,24 @@ static struct conf_server *server_create(struct conf_config *config, } else if (!strcmp((const char *) n->name, "settings")) { - if (server->server_settings) + xmlChar *src = xmlGetProp(n, (xmlChar *) "src"); + WRBUF w; + if (!src) { - yaz_log(YLOG_FATAL, "Can't repeat 'settings'"); + yaz_log(YLOG_FATAL, "Missing src attribute for settings"); return 0; } - if (!(server->server_settings = parse_settings(config, nmem, n))) + if (server->settings_fname) + { + xmlFree(src); + yaz_log(YLOG_FATAL, "Can't repeat 'settings'"); return 0; + } + w = wrbuf_alloc(); + conf_dir_path(config, w, (const char *) src); + server->settings_fname = nmem_strdup(nmem, wrbuf_cstr(w)); + wrbuf_destroy(w); + xmlFree(src); } else if (!strcmp((const char *) n->name, "icu_chain")) { @@ -912,7 +887,7 @@ struct conf_config *config_create(const char *fname, int verbose) config->servers = 0; config->no_threads = 0; config->iochan_man = 0; - config->database_hosts = 0; + config->database_hosts = database_hosts_create(); config->confdir = wrbuf_alloc(); if ((p = strrchr(fname, @@ -979,9 +954,8 @@ void config_destroy(struct conf_config *config) struct conf_server *s_next = server->next; server_destroy(server); server = s_next; + database_hosts_destroy(&config->database_hosts); } - database_hosts_destroy(&config->database_hosts); - wrbuf_destroy(config->confdir); nmem_destroy(config->nmem); } @@ -998,22 +972,18 @@ void config_process_events(struct conf_config *conf) { struct conf_server *ser; - conf->database_hosts = database_hosts_create(); for (ser = conf->servers; ser; ser = ser->next) { struct conf_service *s = ser->service; - ser->database_hosts = conf->database_hosts; - for (;s ; s = s->next) { - resolve_databases(s); assert(s->mutex == 0); pazpar2_mutex_create(&s->mutex, "service"); } http_mutex_init(ser); } - iochan_man_events(conf->iochan_man); + iochan_man_events(conf->iochan_man); } int config_start_listeners(struct conf_config *conf, diff --git a/src/pazpar2_config.h b/src/pazpar2_config.h index c8ea60e..f3c346b 100644 --- a/src/pazpar2_config.h +++ b/src/pazpar2_config.h @@ -30,7 +30,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA enum conf_metadata_type { Metadata_type_generic, // Generic text field - Metadata_type_number, // A number Metadata_type_year, // A number Metadata_type_date // A number }; @@ -110,7 +109,6 @@ struct conf_service struct setting_dictionary *dictionary; struct conf_service *next; char *id; - char *settings; NMEM nmem; int session_timeout; int z3950_session_timeout; @@ -135,7 +133,7 @@ struct conf_server char *proxy_host; int proxy_port; char *myurl; - char *server_settings; + char *settings_fname; char *server_id; pp2_charset_fact_t charsets; diff --git a/src/pazpar2_play.c b/src/pazpar2_play.c index 622885a..5339f2d 100644 --- a/src/pazpar2_play.c +++ b/src/pazpar2_play.c @@ -54,6 +54,7 @@ static int run(FILE *inf, struct addrinfo *res) long long id; int sz, r, c; char req[100]; + char request_type[100]; size_t i; struct con **conp; c = fgetc(inf); @@ -66,8 +67,9 @@ static int run(FILE *inf, struct addrinfo *res) c = fgetc(inf); } req[i] = 0; - r = sscanf(req, "%lld %lld %lld %d", &tv_sec1, &tv_usec1, &id, &sz); - if (r != 4) + r = sscanf(req, "%s %lld %lld %lld %d", request_type, + &tv_sec1, &tv_usec1, &id, &sz); + if (r != 5) { fprintf(stderr, "bad line %s\n", req); return -1; @@ -145,11 +147,14 @@ static int run(FILE *inf, struct addrinfo *res) (long long) toread, (long long) r); return -1; } - w = write((*conp)->fd, buf, toread); - if (w != toread) - { - fprintf(stderr, "write truncated\n"); - return -1; + if (*request_type == 'r') + { /* Only deal with things tha Pazpar2 received */ + w = write((*conp)->fd, buf, toread); + if (w != toread) + { + fprintf(stderr, "write truncated\n"); + return -1; + } } cnt += toread; } diff --git a/src/reclists.c b/src/reclists.c index b4e2a6d..6ac71cd 100644 --- a/src/reclists.c +++ b/src/reclists.c @@ -116,6 +116,7 @@ struct reclist_sortparms *reclist_parse_sortparms(NMEM nmem, const char *parms, new->offset = offset; new->type = type; new->increasing = increasing; + new->name = nmem_strdup(nmem, parm); rp = &new->next; if (*(parms = cpp)) parms++; @@ -313,6 +314,17 @@ struct record_cluster *reclist_insert(struct reclist *l, if (!strcmp(merge_key, (*p)->record->merge_key)) { struct record_cluster *existing = (*p)->record; + struct record *re = existing->records; + + for (; re; re = re->next) + { + if (re->client == record->client && + record_compare(record, re, service)) + { + yaz_mutex_leave(l->mutex); + return 0; + } + } record->next = existing->records; existing->records = record; cluster = existing; diff --git a/src/reclists.h b/src/reclists.h index 6f13e50..26ddd4b 100644 --- a/src/reclists.h +++ b/src/reclists.h @@ -31,6 +31,7 @@ struct reclist_sortparms int offset; enum conf_sortkey_type type; int increasing; + char *name; struct reclist_sortparms *next; }; diff --git a/src/record.c b/src/record.c index c43af42..874a0a2 100644 --- a/src/record.c +++ b/src/record.c @@ -90,98 +90,41 @@ struct record_metadata * record_metadata_create(NMEM nmem) } -struct record_metadata * record_metadata_insert(NMEM nmem, - struct record_metadata ** rmd, - union data_types data) +int record_compare(struct record *r1, struct record *r2, + struct conf_service *service) { - struct record_metadata * tmp_rmd = 0; - // assert(nmem); - - if(!rmd) - return 0; - - // construct new record_metadata - tmp_rmd = nmem_malloc(nmem, sizeof(struct record_metadata)); - tmp_rmd->data = data; - - - // insert in *rmd's place, moving *rmd one down the list - tmp_rmd->next = *rmd; - *rmd = tmp_rmd; - - return *rmd; -} - -struct record_metadata * record_add_metadata_field_id(NMEM nmem, - struct record * record, - int field_id, - union data_types data) -{ - if (field_id < 0 || !record || !record->metadata) - return 0; - - return record_metadata_insert(nmem, &(record->metadata[field_id]), data); -} - - -struct record_metadata * record_add_metadata(NMEM nmem, - struct record * record, - struct conf_service * service, - const char * name, - union data_types data) -{ - int field_id = 0; - - if (!record || !record->metadata || !service || !name) - return 0; - - field_id = conf_service_metadata_field_id(service, name); - - if (-1 == field_id) - return 0; - - return record_metadata_insert(nmem, &(record->metadata[field_id]), data); -} - - - - - - -union data_types * record_assign_sortkey_field_id(NMEM nmem, - struct record * record, - int field_id, - union data_types data) -{ - if (field_id < 0 || !record || !record->sortkeys) - return 0; - - return data_types_assign(nmem, &(record->sortkeys[field_id]), data); -} - - - -union data_types * record_assign_sortkey(NMEM nmem, - struct record * record, - struct conf_service * service, - const char * name, - union data_types data) -{ - int field_id = 0; - - if (!record || !service || !name) - return 0; - - field_id = conf_service_sortkey_field_id(service, name); - - if (!(-1 < field_id) || !(field_id < service->num_sortkeys)) - return 0; - - return record_assign_sortkey_field_id(nmem, record, field_id, data); + int i; + for (i = 0; i < service->num_metadata; i++) + { + struct conf_metadata *ser_md = &service->metadata[i]; + enum conf_metadata_type type = ser_md->type; + + struct record_metadata *m1 = r1->metadata[i]; + struct record_metadata *m2 = r2->metadata[i]; + while (m1 && m2) + { + switch (type) + { + case Metadata_type_generic: + if (strcmp(m1->data.text.disp, m2->data.text.disp)) + return 0; + break; + case Metadata_type_date: + case Metadata_type_year: + if (m1->data.number.min != m2->data.number.min || + m1->data.number.max != m2->data.number.max) + return 0; + break; + } + m1 = m1->next; + m2 = m2->next; + } + if (m1 || m2) + return 0; + } + return 1; } - - /* * Local variables: * c-basic-offset: 4 diff --git a/src/record.h b/src/record.h index 3960f72..b7efc2e 100644 --- a/src/record.h +++ b/src/record.h @@ -72,38 +72,7 @@ struct record * record_create(NMEM nmem, int num_metadata, int num_sortkeys, struct record_metadata * record_metadata_create(NMEM nmem); -struct record_metadata * record_metadata_insert(NMEM nmem, - struct record_metadata ** rmd, - union data_types data); - - -struct record_metadata * record_add_metadata_field_id(NMEM nmem, - struct record * record, - int field_id, - union data_types data); - - -struct record_metadata * record_add_metadata(NMEM nmem, - struct record * record, - struct conf_service * service, - const char * name, - union data_types data); - - -union data_types * record_assign_sortkey_field_id(NMEM nmem, - struct record * record, - int field_id, - union data_types data); - - -union data_types * record_assign_sortkey(NMEM nmem, - struct record * record, - struct conf_service * service, - const char * name, - union data_types data); - - - +int record_compare(struct record *r1, struct record *r2, struct conf_service *service); struct record_cluster { @@ -120,9 +89,6 @@ struct record_cluster struct record *records; }; - - - #endif // RECORD_H /* diff --git a/src/session.c b/src/session.c index 72feef6..388e94e 100644 --- a/src/session.c +++ b/src/session.c @@ -95,6 +95,12 @@ struct client_list { struct client_list *next; }; +struct session_sorted_results { + const char *field; + int increasing; + struct session_sorted_results *next; +}; + /* session counting (1) , disable client counting (0) */ static YAZ_MUTEX g_session_mutex = 0; static int no_sessions = 0; @@ -246,13 +252,13 @@ static xmlDoc *record_to_xml(struct session *se, if (!rdoc) { session_log(se, YLOG_FATAL, "Non-wellformed XML received from %s", - db->url); + db->id); return 0; } if (global_parameters.dump_records) { - session_log(se, YLOG_LOG, "Un-normalized record from %s", db->url); + session_log(se, YLOG_LOG, "Un-normalized record from %s", db->id); log_xml_doc(rdoc); } @@ -340,7 +346,7 @@ static xmlDoc *normalize_record(struct session *se, if (normalize_record_transform(sdb->map, &rdoc, (const char **)parms)) { session_log(se, YLOG_WARN, "Normalize failed from %s", - sdb->database->url); + sdb->database->id); } else { @@ -349,7 +355,7 @@ static xmlDoc *normalize_record(struct session *se, if (global_parameters.dump_records) { session_log(se, YLOG_LOG, "Normalized record from %s", - sdb->database->url); + sdb->database->id); log_xml_doc(rdoc); } } @@ -401,7 +407,7 @@ static int prepare_map(struct session *se, struct session_database *sdb) if (!sdb->settings) { - session_log(se, YLOG_WARN, "No settings on %s", sdb->database->url); + session_log(se, YLOG_WARN, "No settings on %s", sdb->database->id); return -1; } if ((s = session_setting_oneval(sdb, PZ_XSLT))) @@ -447,7 +453,7 @@ static int prepare_session_database(struct session *se, if (!sdb->settings) { session_log(se, YLOG_WARN, - "No settings associated with %s", sdb->database->url); + "No settings associated with %s", sdb->database->id); return -1; } if (sdb->settings[PZ_XSLT] && !sdb->map) @@ -521,11 +527,12 @@ void session_alert_watch(struct session *s, int what) } //callback for grep_databases -static void select_targets_callback(void *context, struct session_database *db) +static void select_targets_callback(struct session *se, + struct session_database *db) { - struct session *se = (struct session*) context; - struct client *cl = client_create(); + struct client *cl = client_create(db->database->id); struct client_list *l; + client_set_database(cl, db); client_set_session(cl, se); @@ -590,12 +597,84 @@ int session_is_preferred_clients_ready(struct session *s) return res == 0; } -enum pazpar2_error_code search(struct session *se, - const char *query, - const char *startrecs, const char *maxrecs, - const char *filter, - const char *limit, - const char **addinfo) +static const char *get_strategy_plus_sort(struct client *l, const char *field) +{ + struct session_database *sdb = client_get_database(l); + struct setting *s; + + const char *strategy_plus_sort = 0; + + for (s = sdb->settings[PZ_SORTMAP]; s; s = s->next) + { + char *p = strchr(s->name + 3, ':'); + if (!p) + { + yaz_log(YLOG_WARN, "Malformed sortmap name: %s", s->name); + continue; + } + p++; + if (!strcmp(p, field)) + { + strategy_plus_sort = s->value; + break; + } + } + return strategy_plus_sort; +} + +void session_sort(struct session *se, const char *field, int increasing) +{ + struct session_sorted_results *sr; + struct client_list *l; + + session_enter(se); + + /* see if we already have sorted for this critieria */ + for (sr = se->sorted_results; sr; sr = sr->next) + { + if (!strcmp(field, sr->field) && increasing == sr->increasing) + break; + } + if (sr) + { + yaz_log(YLOG_LOG, "search_sort: field=%s increasing=%d already fetched", + field, increasing); + session_leave(se); + return; + } + yaz_log(YLOG_LOG, "search_sort: field=%s increasing=%d must fetch", + field, increasing); + sr = nmem_malloc(se->nmem, sizeof(*sr)); + sr->field = nmem_strdup(se->nmem, field); + sr->increasing = increasing; + sr->next = se->sorted_results; + se->sorted_results = sr; + + for (l = se->clients; l; l = l->next) + { + struct client *cl = l->client; + const char *strategy_plus_sort = get_strategy_plus_sort(cl, field); + if (strategy_plus_sort) + { + struct timeval tval; + if (client_prep_connection(cl, se->service->z3950_operation_timeout, + se->service->z3950_session_timeout, + se->service->server->iochan_man, + &tval)) + client_start_search(cl, strategy_plus_sort, increasing); + } + } + session_leave(se); +} + +enum pazpar2_error_code session_search(struct session *se, + const char *query, + const char *startrecs, + const char *maxrecs, + const char *filter, + const char *limit, + const char **addinfo, + const char *sort_field, int increasing) { int live_channels = 0; int no_working = 0; @@ -615,8 +694,15 @@ enum pazpar2_error_code search(struct session *se, se->reclist = 0; relevance_destroy(&se->relevance); nmem_reset(se->nmem); - se->total_records = se->total_hits = se->total_merged = 0; + se->total_records = se->total_merged = 0; se->num_termlists = 0; + + /* reset list of sorted results and clear to relevance search */ + se->sorted_results = nmem_malloc(se->nmem, sizeof(*se->sorted_results)); + se->sorted_results->field = nmem_strdup(se->nmem, sort_field); + se->sorted_results->increasing = increasing; + se->sorted_results->next = 0; + live_channels = select_targets(se, filter); if (!live_channels) { @@ -639,6 +725,7 @@ enum pazpar2_error_code search(struct session *se, for (l = se->clients; l; l = l->next) { struct client *cl = l->client; + const char *strategy_plus_sort = get_strategy_plus_sort(cl, sort_field); if (maxrecs) client_set_maxrecs(cl, atoi(maxrecs)); @@ -655,7 +742,7 @@ enum pazpar2_error_code search(struct session *se, se->service->z3950_session_timeout, se->service->server->iochan_man, &tval)) - client_start_search(cl); + client_start_search(cl, strategy_plus_sort, increasing); } } facet_limits_destroy(facet_limits); @@ -717,8 +804,6 @@ static struct session_database *load_session_database(struct session *se, { struct database *db = new_database(id, se->session_nmem); - resolve_database(se->service, db); - session_init_databases_fun((void*) se, db); // New sdb is head of se->databases list @@ -732,7 +817,7 @@ static struct session_database *find_session_database(struct session *se, struct session_database *sdb; for (sdb = se->databases; sdb; sdb = sdb->next) - if (!strcmp(sdb->database->url, id)) + if (!strcmp(sdb->database->id, id)) return sdb; return load_session_database(se, id); } @@ -815,7 +900,6 @@ struct session *new_session(NMEM nmem, struct conf_service *service, session_log(session, YLOG_DEBUG, "New"); session->service = service; session->relevance = 0; - session->total_hits = 0; session->total_records = 0; session->number_of_warnings_unknown_elements = 0; session->number_of_warnings_unknown_metadata = 0; @@ -837,13 +921,13 @@ struct session *new_session(NMEM nmem, struct conf_service *service, return session; } -struct hitsbytarget *hitsbytarget(struct session *se, int *count, NMEM nmem) +static struct hitsbytarget *hitsbytarget_nb(struct session *se, + int *count, NMEM nmem) { struct hitsbytarget *res = 0; struct client_list *l; size_t sz = 0; - session_enter(se); for (l = se->clients; l; l = l->next) sz++; @@ -856,7 +940,7 @@ struct hitsbytarget *hitsbytarget(struct session *se, int *count, NMEM nmem) const char *name = session_setting_oneval(client_get_database(cl), PZ_NAME); - res[*count].id = client_get_database(cl)->database->url; + res[*count].id = client_get_id(cl); res[*count].name = *name ? name : "Unknown"; res[*count].hits = client_get_hits(cl); res[*count].records = client_get_num_records(cl); @@ -868,10 +952,18 @@ struct hitsbytarget *hitsbytarget(struct session *se, int *count, NMEM nmem) wrbuf_destroy(w); (*count)++; } - session_leave(se); return res; } +struct hitsbytarget *get_hitsbytarget(struct session *se, int *count, NMEM nmem) +{ + struct hitsbytarget *p; + session_enter(se); + p = hitsbytarget_nb(se, count, nmem); + session_leave(se); + return p; +} + struct termlist_score **get_termlist_score(struct session *se, const char *name, int *num) { @@ -889,6 +981,116 @@ struct termlist_score **get_termlist_score(struct session *se, return tl; } +// Compares two hitsbytarget nodes by hitcount +static int cmp_ht(const void *p1, const void *p2) +{ + const struct hitsbytarget *h1 = p1; + const struct hitsbytarget *h2 = p2; + return h2->hits - h1->hits; +} + +static int targets_termlist_nb(WRBUF wrbuf, struct session *se, int num, + NMEM nmem) +{ + struct hitsbytarget *ht; + int count, i; + + ht = hitsbytarget_nb(se, &count, nmem); + qsort(ht, count, sizeof(struct hitsbytarget), cmp_ht); + for (i = 0; i < count && i < num && ht[i].hits > 0; i++) + { + + // do only print terms which have display names + + wrbuf_puts(wrbuf, "\n"); + + wrbuf_puts(wrbuf, ""); + wrbuf_xmlputs(wrbuf, ht[i].id); + wrbuf_puts(wrbuf, "\n"); + + wrbuf_puts(wrbuf, ""); + if (!ht[i].name || !ht[i].name[0]) + wrbuf_xmlputs(wrbuf, "NO TARGET NAME"); + else + wrbuf_xmlputs(wrbuf, ht[i].name); + wrbuf_puts(wrbuf, "\n"); + + wrbuf_printf(wrbuf, "" ODR_INT_PRINTF "\n", + ht[i].hits); + + wrbuf_puts(wrbuf, ""); + wrbuf_xmlputs(wrbuf, ht[i].state); + wrbuf_puts(wrbuf, "\n"); + + wrbuf_printf(wrbuf, "%d\n", + ht[i].diagnostic); + wrbuf_puts(wrbuf, "\n"); + } + return count; +} + +void perform_termlist(struct http_channel *c, struct session *se, + const char *name, int num) +{ + int i, j; + NMEM nmem_tmp = nmem_create(); + char **names; + int num_names = 0; + + if (name) + nmem_strsplit(nmem_tmp, ",", name, &names, &num_names); + + session_enter(se); + + for (j = 0; j < num_names; j++) + { + const char *tname; + + wrbuf_puts(c->wrbuf, "wrbuf, names[j]); + wrbuf_puts(c->wrbuf, "\">\n"); + + for (i = 0; i < se->num_termlists; i++) + { + tname = se->termlists[i].name; + if (num_names > 0 && !strcmp(names[j], tname)) + { + struct termlist_score **p = 0; + int len; + p = termlist_highscore(se->termlists[i].termlist, &len); + if (p) + { + int i; + for (i = 0; i < len && i < num; i++) + { + // prevent sending empty term elements + if (!p[i]->display_term || !p[i]->display_term[0]) + continue; + + wrbuf_puts(c->wrbuf, ""); + wrbuf_puts(c->wrbuf, ""); + wrbuf_xmlputs(c->wrbuf, p[i]->display_term); + wrbuf_puts(c->wrbuf, ""); + + wrbuf_printf(c->wrbuf, + "%d", + p[i]->frequency); + wrbuf_puts(c->wrbuf, "\n"); + } + } + } + } + tname = "xtargets"; + if (num_names > 0 && !strcmp(names[j], tname)) + { + targets_termlist_nb(c->wrbuf, se, num, c->nmem); + } + wrbuf_puts(c->wrbuf, "\n"); + } + session_leave(se); + nmem_destroy(nmem_tmp); +} + #ifdef MISSING_HEADERS void report_nmem_stats(void) { @@ -956,6 +1158,8 @@ struct record_cluster **show_range_start(struct session *se, } else { + struct client_list *l; + for (spp = sp; spp; spp = spp->next) if (spp->type == Metadata_sortkey_relevance) { @@ -966,7 +1170,10 @@ struct record_cluster **show_range_start(struct session *se, reclist_enter(se->reclist); *total = reclist_get_num_records(se->reclist); - *sumhits = se->total_hits; + + *sumhits = 0; + for (l = se->clients; l; l = l->next) + *sumhits += client_get_hits(l->client); for (i = 0; i < start; i++) if (!reclist_read_record(se->reclist)) @@ -1009,11 +1216,13 @@ void statistics(struct session *se, struct statistics *stat) int count = 0; memset(stat, 0, sizeof(*stat)); + stat->num_hits = 0; for (l = se->clients; l; l = l->next) { struct client *cl = l->client; if (!client_get_connection(cl)) stat->num_no_connection++; + stat->num_hits += client_get_hits(cl); switch (client_get_state(cl)) { case Client_Connecting: stat->num_connecting++; break; @@ -1025,7 +1234,6 @@ void statistics(struct session *se, struct statistics *stat) } count++; } - stat->num_hits = se->total_hits; stat->num_records = se->total_records; stat->num_clients = count; @@ -1185,8 +1393,13 @@ static const char *get_mergekey(xmlDoc *doc, struct client *cl, int record_no, /* generate unique key if none is not generated already or is empty */ if (wrbuf_len(norm_wr) == 0) { - wrbuf_printf(norm_wr, "%s-%d", - client_get_database(cl)->database->url, record_no); + wrbuf_printf(norm_wr, "position: %s-%d", + client_get_id(cl), record_no); + } + else + { + const char *lead = "content: "; + wrbuf_insert(norm_wr, 0, lead, strlen(lead)); } if (wrbuf_len(norm_wr) > 0) mergekey_norm = nmem_strdup(nmem, wrbuf_cstr(norm_wr)); @@ -1290,7 +1503,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->url); + record_no, sdb->database->id); xmlFreeDoc(xdoc); return -2; } @@ -1304,7 +1517,7 @@ int ingest_record(struct client *cl, const char *rec, } session_enter(se); if (client_get_session(cl) == se) - ret = ingest_to_cluster(cl, xdoc, root, record_no, mergekey_norm); + ingest_to_cluster(cl, xdoc, root, record_no, mergekey_norm); session_leave(se); xmlFreeDoc(xdoc); @@ -1320,43 +1533,18 @@ static int ingest_to_cluster(struct client *cl, xmlNode *n; xmlChar *type = 0; xmlChar *value = 0; - struct session_database *sdb = client_get_database(cl); struct session *se = client_get_session(cl); struct conf_service *service = se->service; + int term_factor = 1; + struct record_cluster *cluster; + struct session_database *sdb = client_get_database(cl); struct record *record = record_create(se->nmem, service->num_metadata, service->num_sortkeys, cl, record_no); - struct record_cluster *cluster = reclist_insert(se->reclist, - service, - record, - mergekey_norm, - &se->total_merged); - - const char *use_term_factor_str = session_setting_oneval(sdb, PZ_TERMLIST_TERM_FACTOR); - int use_term_factor = 0; - int term_factor = 1; - if (use_term_factor_str && use_term_factor_str[0] != 0) - use_term_factor = atoi(use_term_factor_str); - if (use_term_factor) { - int maxrecs = client_get_maxrecs(cl); - int hits = (int) client_get_hits(cl); - term_factor = MAX(hits, maxrecs) / MAX(1, maxrecs); - assert(term_factor >= 1); - yaz_log(YLOG_DEBUG, "Using term factor: %d (%d / %d)", term_factor, MAX(hits, maxrecs), MAX(1, maxrecs)); - } - if (!cluster) - return -1; - if (global_parameters.dump_records) - session_log(se, YLOG_LOG, "Cluster id %s from %s (#%d)", cluster->recid, - sdb->database->url, record_no); - relevance_newrec(se->relevance, cluster); - - // now parsing XML record and adding data to cluster or record metadata for (n = root->children; n; n = n->next) { - pp2_charset_token_t prt; if (type) xmlFree(type); if (value) @@ -1368,11 +1556,9 @@ static int ingest_to_cluster(struct client *cl, if (!strcmp((const char *) n->name, "metadata")) { struct conf_metadata *ser_md = 0; - struct conf_sortkey *ser_sk = 0; struct record_metadata **wheretoput = 0; struct record_metadata *rec_md = 0; int md_field_id = -1; - int sk_field_id = -1; type = xmlGetProp(n, (xmlChar *) "type"); value = xmlNodeListGetString(xdoc, n->children, 1); @@ -1392,13 +1578,8 @@ static int ingest_to_cluster(struct client *cl, se->number_of_warnings_unknown_metadata++; continue; } - + ser_md = &service->metadata[md_field_id]; - - if (ser_md->sortkey_offset >= 0){ - sk_field_id = ser_md->sortkey_offset; - ser_sk = &service->sortkeys[sk_field_id]; - } // non-merged metadata rec_md = record_metadata_init(se->nmem, (const char *) value, @@ -1413,10 +1594,80 @@ static int ingest_to_cluster(struct client *cl, while (*wheretoput) wheretoput = &(*wheretoput)->next; *wheretoput = rec_md; + } + } + + cluster = reclist_insert(se->reclist, service, record, + mergekey_norm, &se->total_merged); + if (!cluster) + return -1; + + { + const char *use_term_factor_str = + session_setting_oneval(sdb, PZ_TERMLIST_TERM_FACTOR); + if (use_term_factor_str && use_term_factor_str[0] == '1') + { + int maxrecs = client_get_maxrecs(cl); + int hits = (int) client_get_hits(cl); + term_factor = MAX(hits, maxrecs) / MAX(1, maxrecs); + assert(term_factor >= 1); + yaz_log(YLOG_DEBUG, "Using term factor: %d (%d / %d)", term_factor, MAX(hits, maxrecs), MAX(1, maxrecs)); + } + } + + if (global_parameters.dump_records) + session_log(se, YLOG_LOG, "Cluster id %s from %s (#%d)", cluster->recid, + sdb->database->id, record_no); + + + relevance_newrec(se->relevance, cluster); + + // now parsing XML record and adding data to cluster or record metadata + for (n = root->children; n; n = n->next) + { + pp2_charset_token_t prt; + if (type) + xmlFree(type); + if (value) + xmlFree(value); + type = value = 0; + + if (n->type != XML_ELEMENT_NODE) + continue; + if (!strcmp((const char *) n->name, "metadata")) + { + struct conf_metadata *ser_md = 0; + struct conf_sortkey *ser_sk = 0; + struct record_metadata **wheretoput = 0; + struct record_metadata *rec_md = 0; + int md_field_id = -1; + int sk_field_id = -1; + + type = xmlGetProp(n, (xmlChar *) "type"); + value = xmlNodeListGetString(xdoc, n->children, 1); + + if (!type || !value || !*value) + continue; + + md_field_id + = conf_service_metadata_field_id(service, (const char *) type); + if (md_field_id < 0) + continue; + + ser_md = &service->metadata[md_field_id]; + + if (ser_md->sortkey_offset >= 0) + { + sk_field_id = ser_md->sortkey_offset; + ser_sk = &service->sortkeys[sk_field_id]; + } // merged metadata rec_md = record_metadata_init(se->nmem, (const char *) value, ser_md->type, 0); + if (!rec_md) + continue; + wheretoput = &cluster->metadata[md_field_id]; // and polulate with data: diff --git a/src/session.h b/src/session.h index fbb4e3c..38e3a38 100644 --- a/src/session.h +++ b/src/session.h @@ -52,14 +52,9 @@ enum pazpar2_error_code { PAZPAR2_LAST_ERROR }; -struct host; -// Represents a (virtual) database on a host +// Represents a database struct database { - struct host *host; - char *url; - char **databases; - int errors; - struct zr_explain *explain; + char *id; int num_settings; struct setting **settings; struct database *next; @@ -112,7 +107,6 @@ struct session { struct relevance *relevance; struct reclist *reclist; struct session_watchentry watchlist[SESSION_WATCH_MAX + 1]; - Odr_int total_hits; int total_records; int total_merged; int number_of_warnings_unknown_elements; @@ -120,6 +114,7 @@ struct session { normalize_cache_t normalize_cache; YAZ_MUTEX session_mutex; unsigned session_id; + struct session_sorted_results *sorted_results; }; struct statistics { @@ -135,7 +130,7 @@ struct statistics { }; struct hitsbytarget { - char *id; + const char *id; const char *name; Odr_int hits; int diagnostic; @@ -145,17 +140,21 @@ struct hitsbytarget { char *settings_xml; }; -struct hitsbytarget *hitsbytarget(struct session *s, int *count, NMEM nmem); +struct hitsbytarget *get_hitsbytarget(struct session *s, int *count, NMEM nmem); struct session *new_session(NMEM nmem, struct conf_service *service, unsigned session_id); void destroy_session(struct session *s); void session_init_databases(struct session *s); -int load_targets(struct session *s, const char *fn); void statistics(struct session *s, struct statistics *stat); -enum pazpar2_error_code search(struct session *s, const char *query, - const char *startrecs, const char *maxrecs, - const char *filter, const char *limit, - const char **addinfo); + +void session_sort(struct session *se, const char *field, int increasing); + +enum pazpar2_error_code session_search(struct session *s, const char *query, + const char *startrecs, + const char *maxrecs, + const char *filter, const char *limit, + const char **addinfo, + const char *sort_field, int increasing); struct record_cluster **show_range_start(struct session *s, struct reclist_sortparms *sp, int start, @@ -174,11 +173,12 @@ int session_is_preferred_clients_ready(struct session *s); void session_apply_setting(struct session *se, char *dbname, char *setting, char *value); const char *session_setting_oneval(struct session_database *db, int offset); -int host_getaddrinfo(struct host *host, iochan_man_t iochan_man); - int ingest_record(struct client *cl, const char *rec, int record_no, NMEM nmem); 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 session_log(struct session *s, int level, const char *fmt, ...) #ifdef __GNUC__ __attribute__ ((format (printf, 3, 4))) diff --git a/src/settings.c b/src/settings.c index 3455344..d355cf3 100644 --- a/src/settings.c +++ b/src/settings.c @@ -59,7 +59,6 @@ static char *hard_settings[] = { "pz:id", "pz:name", "pz:queryencoding", - "pz:ip", "pz:zproxy", "pz:apdulog", "pz:sru", @@ -70,14 +69,15 @@ static char *hard_settings[] = { "pz:pqf_strftime", "pz:negotiation_charset", "pz:max_connections", - "pz:reuse_connections", /* PZ_REUSE_CONNECTION */ - "pz:termlist_term_factor", /* PZ_TERMLIST_TERM_FACTOR*/ - "pz:preferred", /* PZ_PREFERRED */ - "pz:extra_args", /* PZ_EXTRA_ARGS */ - "pz:query_syntax", /* PZ_QUERY_SYNTAX */ - "pz:option_recordfilter", /* PZ_OPTION_RECORDFILTER */ - "pz:facetmap:", /* PZ_FACETMAP */ - "pz:limitmap:", /* PZ_LIMITMAP */ + "pz:reuse_connections", + "pz:termlist_term_factor", + "pz:preferred", + "pz:extra_args", + "pz:query_syntax", + "pz:facetmap:", + "pz:limitmap:", + "pz:url", + "pz:sortmap:", 0 }; @@ -335,7 +335,7 @@ void expand_settings_array(struct setting ***set_ar, int *num, int offset, // 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(void *context, struct database *db) +static void update_database_fun(void *context, struct database *db) { struct setting *set = ((struct update_database_context *) context)->set; @@ -345,7 +345,7 @@ static void update_database(void *context, struct database *db) int offset; // Is this the right database? - if (!match_zurl(db->url, set->target)) + if (!match_zurl(db->id, set->target)) return; offset = settings_create_offset(service, set->name); @@ -403,7 +403,7 @@ static void update_databases(void *client_data, struct setting *set) struct update_database_context context; context.set = set; context.service = service; - predef_grep_databases(&context, service, update_database); + predef_grep_databases(&context, service, update_database_fun); } // This simply copies the 'hard' (application-specific) settings @@ -444,7 +444,7 @@ static void prepare_target_dictionary(void *client_data, struct setting *set) // If target address is not wildcard, add the database if (*set->target && !zurl_wildcard(set->target)) - find_database(set->target, service); + create_database_for_service(set->target, service); // Determine if we already have a dictionary entry if (!strncmp(set->name, "pz:", 3) && (p = strchr(set->name + 3, ':'))) diff --git a/src/settings.h b/src/settings.h index e6e70f4..3451588 100644 --- a/src/settings.h +++ b/src/settings.h @@ -32,25 +32,25 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define PZ_ID 9 #define PZ_NAME 10 #define PZ_QUERYENCODING 11 -#define PZ_IP 12 -#define PZ_ZPROXY 13 -#define PZ_APDULOG 14 -#define PZ_SRU 15 -#define PZ_SRU_VERSION 16 -#define PZ_PQF_PREFIX 17 -#define PZ_SORT 18 -#define PZ_RECORDFILTER 19 -#define PZ_PQF_STRFTIME 20 -#define PZ_NEGOTIATION_CHARSET 21 -#define PZ_MAX_CONNECTIONS 22 -#define PZ_REUSE_CONNECTIONS 23 -#define PZ_TERMLIST_TERM_FACTOR 24 -#define PZ_PREFERRED 25 -#define PZ_EXTRA_ARGS 26 -#define PZ_QUERY_SYNTAX 27 -#define PZ_OPTION_RECORDFILTER 28 -#define PZ_FACETMAP 29 -#define PZ_LIMITMAP 30 +#define PZ_ZPROXY 12 +#define PZ_APDULOG 13 +#define PZ_SRU 14 +#define PZ_SRU_VERSION 15 +#define PZ_PQF_PREFIX 16 +#define PZ_SORT 17 +#define PZ_RECORDFILTER 18 +#define PZ_PQF_STRFTIME 19 +#define PZ_NEGOTIATION_CHARSET 20 +#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 struct setting @@ -70,7 +70,6 @@ int settings_num(struct conf_service *service); int settings_create_offset(struct conf_service *service, const char *name); int settings_lookup_offset(struct conf_service *service, const char *name); void init_settings(struct conf_service *service); -void resolve_databases(struct conf_service *service); void settings_read_node_x(xmlNode *n, void *client_data, void (*fun)(void *client_data, diff --git a/test/Makefile.am b/test/Makefile.am index e2121e8..e6521da 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,7 +1,7 @@ # 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_solr.sh test_url.sh EXTRA_DIST = run_pazpar2.sh marc21_test.xsl tmarc.xsl solr-pz2.xsl \ z3950_indexdata_com_marc.xml \ @@ -13,6 +13,7 @@ EXTRA_DIST = run_pazpar2.sh marc21_test.xsl tmarc.xsl solr-pz2.xsl \ test_settings.cfg test_settings.urls \ test_solr.cfg test_solr.urls \ test_turbomarcxml.cfg test_turbomarcxml.urls \ + test_url.cfg test_url.urls \ $(check_SCRIPTS) TESTS = $(check_SCRIPTS) diff --git a/test/test_facets_11.res b/test/test_facets_11.res index a63c538..aaf0155 100644 --- a/test/test_facets_11.res +++ b/test/test_facets_11.res @@ -1,5 +1,5 @@ - -0 + +0 localhost:9999/db1 @@ -47,4 +47,4 @@ - + \ No newline at end of file diff --git a/test/test_facets_13.res b/test/test_facets_13.res index f3c7728..a399233 100644 --- a/test/test_facets_13.res +++ b/test/test_facets_13.res @@ -1,6 +1,5 @@ - -OK +OK 0 1 8 @@ -17,6 +16,6 @@ Jack Collins 2 240000 -title how to program a computer author jack collins +content: title how to program a computer author jack collins - + \ No newline at end of file diff --git a/test/test_facets_14.res b/test/test_facets_14.res index 812c1c9..37b5a75 100644 --- a/test/test_facets_14.res +++ b/test/test_facets_14.res @@ -1,5 +1,5 @@ - -0 + +0 localhost:9999/db1 @@ -47,4 +47,4 @@ - + \ No newline at end of file diff --git a/test/test_facets_16.res b/test/test_facets_16.res index 95f4261..a6464e4 100644 --- a/test/test_facets_16.res +++ b/test/test_facets_16.res @@ -1,6 +1,5 @@ - -OK +OK 0 1 6 @@ -17,6 +16,6 @@ Jack Collins 2 240000 -title how to program a computer author jack collins +content: title how to program a computer author jack collins - + \ No newline at end of file diff --git a/test/test_facets_17.res b/test/test_facets_17.res index abb5f68..00e11f8 100644 --- a/test/test_facets_17.res +++ b/test/test_facets_17.res @@ -1,5 +1,5 @@ - -0 + +0 localhost:9999/db1 @@ -47,4 +47,4 @@ - + \ No newline at end of file diff --git a/test/test_facets_18.res b/test/test_facets_18.res index abb5f68..00e11f8 100644 --- a/test/test_facets_18.res +++ b/test/test_facets_18.res @@ -1,5 +1,5 @@ - -0 + +0 localhost:9999/db1 @@ -47,4 +47,4 @@ - + \ No newline at end of file diff --git a/test/test_facets_23.res b/test/test_facets_23.res index 6d2e235..15d66ce 100644 --- a/test/test_facets_23.res +++ b/test/test_facets_23.res @@ -1,6 +1,5 @@ - -OK +OK 0 8 9 @@ -17,7 +16,7 @@ Jack Collins 2 28267 -title how to program a computer author jack collins +content: title how to program a computer author jack collins @@ -28,7 +27,7 @@ proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976 1977 23556 -title computer science technology +content: title computer science technology @@ -40,7 +39,7 @@ Hebrew and Greek; introductions in English Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates 23556 -title the computer bible +content: title the computer bible @@ -55,7 +54,7 @@ Englund, Carl R "Contract DOT-UT-10003." 10095 -title washington metropolitan area rail computer feasibility study author englund carl r +content: title washington metropolitan area rail computer feasibility study author englund carl r @@ -70,7 +69,7 @@ Mairs, John W Scale of maps ca. 1:1,000,000 9815 -title the puget sound region author mairs john w +content: title the puget sound region author mairs john w @@ -81,7 +80,7 @@ the proceedings of a workshop 1974 7067 -title computer processing of dynamic images from an anger scintillation camera +content: title computer processing of dynamic images from an anger scintillation camera @@ -92,7 +91,7 @@ 1977 Wood, Helen M 7067 -title the use of passwords for controlled access to computer resources author wood helen m +content: title the use of passwords for controlled access to computer resources author wood helen m @@ -103,6 +102,6 @@ proceedings of the workshop 1977 0 -title reconstruction tomography in diagnostic radiology and nuclear medicine +content: title reconstruction tomography in diagnostic radiology and nuclear medicine - + \ No newline at end of file diff --git a/test/test_facets_24.res b/test/test_facets_24.res index 8be225c..598b204 100644 --- a/test/test_facets_24.res +++ b/test/test_facets_24.res @@ -1,5 +1,5 @@ - -0 + +0 localhost:9999/db1 @@ -42,4 +42,4 @@ - + \ No newline at end of file diff --git a/test/test_facets_4.res b/test/test_facets_4.res index 1e4328b..dbe5c12 100644 --- a/test/test_facets_4.res +++ b/test/test_facets_4.res @@ -1,6 +1,5 @@ - -OK +OK 0 6 7 @@ -17,7 +16,7 @@ Jack Collins 2 36996 -title how to program a computer author jack collins +content: title how to program a computer author jack collins @@ -28,7 +27,7 @@ proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976 1977 30830 -title computer science technology +content: title computer science technology @@ -40,7 +39,7 @@ Hebrew and Greek; introductions in English Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates 30830 -title the computer bible +content: title the computer bible @@ -55,7 +54,7 @@ Mairs, John W Scale of maps ca. 1:1,000,000 12845 -title the puget sound region author mairs john w +content: title the puget sound region author mairs john w @@ -66,7 +65,7 @@ the proceedings of a workshop 1974 9249 -title computer processing of dynamic images from an anger scintillation camera +content: title computer processing of dynamic images from an anger scintillation camera @@ -77,6 +76,6 @@ proceedings of the workshop 1977 0 -title reconstruction tomography in diagnostic radiology and nuclear medicine +content: title reconstruction tomography in diagnostic radiology and nuclear medicine - + \ No newline at end of file diff --git a/test/test_facets_6.res b/test/test_facets_6.res index 8755ee8..ebb8bb4 100644 --- a/test/test_facets_6.res +++ b/test/test_facets_6.res @@ -1,5 +1,5 @@ - -0 + +0 localhost:9999/db1 @@ -32,4 +32,4 @@ - + \ No newline at end of file diff --git a/test/test_facets_9.res b/test/test_facets_9.res index 1ef9b8e..6bbd0d6 100644 --- a/test/test_facets_9.res +++ b/test/test_facets_9.res @@ -1,6 +1,5 @@ - -OK +OK 0 1 4 @@ -17,6 +16,6 @@ Jack Collins 2 240000 -title how to program a computer author jack collins +content: title how to program a computer author jack collins - + \ No newline at end of file diff --git a/test/test_http.urls b/test/test_http.urls index eb3828f..c6feb28 100644 --- a/test/test_http.urls +++ b/test/test_http.urls @@ -3,8 +3,8 @@ http://localhost:9763/search.pz2?session=1&command=stat http://localhost:9763/search.pz2?session=1&command=ping http://localhost:9763/search.pz2?session=1&command=search&query=computer 2 http://localhost:9763/search.pz2?session=1&command=show&block=1 -http://localhost:9763/search.pz2?session=1&command=record&id=title+how+to+program+a+computer+author+jack+collins+medium+book -http://localhost:9763/search.pz2?session=1&command=record&id=title+how+to+program+a+computer+author+jack+collins+medium+book&offset=0 +http://localhost:9763/search.pz2?session=1&command=record&id=content%3A+title+how+to+program+a+computer+author+jack+collins+medium+book +http://localhost:9763/search.pz2?session=1&command=record&id=content%3A+title+how+to+program+a+computer+author+jack+collins+medium+book&offset=0 http://localhost:9763/search.pz2?session=1&command=show&start=0&number=1&sort=title:0 http://localhost:9763/search.pz2?session=1&command=show&start=0&number=1&sort=title:1 http://localhost:9763/search.pz2?session=1&command=show&start=0&number=1&sort=date:0 @@ -20,9 +20,9 @@ http://localhost:9763/search.pz2?session=2&command=search&query=kubiak%20stanis% http://localhost:9763/search.pz2?session=2&command=search&query=kubiak%20sts%C5%82aw 2 http://localhost:9763/search.pz2?session=2&command=bytarget http://localhost:9763/search.pz2?session=1&command=search&query=computer -1 http://localhost:9763/search.pz2?session=1&command=record&id=title+how+to+program+a+computer+author+jack+collins+medium+book -http://localhost:9763/search.pz2?session=1&command=record&id=title+how+to+program+a+computer+author+jack+collins+medium+book&offset=0&binary=1 -http://localhost:9763/search.pz2?session=1&command=record&id=title+how+to+program+a+computer+author+jack+collins+medium+book&offset=0&binary=1&syntax=usmarc +1 http://localhost:9763/search.pz2?session=1&command=record&id=content%3A+title+how+to+program+a+computer+author+jack+collins+medium+book +http://localhost:9763/search.pz2?session=1&command=record&id=content%3A+title+how+to+program+a+computer+author+jack+collins+medium+book&offset=0&binary=1 +http://localhost:9763/search.pz2?session=1&command=record&id=content%3A+title+how+to+program+a+computer+author+jack+collins+medium+book&offset=0&binary=1&syntax=usmarc http://localhost:9763/search.pz2?command=init&service=gils http://localhost:9763/search.pz2?session=3&command=search&query=utah 2 http://localhost:9763/search.pz2?session=3&command=show&block=1 @@ -43,12 +43,12 @@ http://localhost:9763/search.pz2?session=5&command=show&block=1 http://localhost:9763/search.pz2?command=init&pz:elements%5Bz3950.indexdata.com%2Fmarc%5D=F 1 http://localhost:9763/search.pz2?session=6&command=search&query=louis 1 http://localhost:9763/search.pz2?session=6&command=show&block=1 -http://localhost:9763/search.pz2?session=6&command=record&id=title+computer+processing+of+dynamic+images+from+an+anger+scintillation+camera+author+medium+book&offset=0 +http://localhost:9763/search.pz2?session=6&command=record&id=content%3A+title+computer+processing+of+dynamic+images+from+an+anger+scintillation+camera+author+medium+book&offset=0 http://localhost:9763/search.pz2?command=init&pz:elements%5Bz3950.indexdata.com%2Fmarc%5D=F http://localhost:9763/search.pz2?session=7&command=search&query=greece 1 http://localhost:9763/search.pz2?session=7&command=show&block=1 1 http://localhost:9763/search.pz2?session=6&command=show&block=1 -http://localhost:9763/search.pz2?session=6&command=record&id=title+computer+processing+of+dynamic+images+from+an+anger+scintillation+camera+author+medium+book&offset=0 +http://localhost:9763/search.pz2?session=6&command=record&id=content%3A+title+computer+processing+of+dynamic+images+from+an+anger+scintillation+camera+author+medium+book&offset=0 http://localhost:9763/search.pz2?command=init http://localhost:9763/search.pz2?session=8&command=settings&pz:name%5Bz3950.indexdata.com%2Fmarc%5D=marc&pz:requestsyntax%5Bz3950.indexdata.com%2Fmarc%5D=usmarc&pz:nativesyntax%5Bz3950.indexdata.com%2Fmarc%5D=iso2709&pz:xslt%5Bz3950.indexdata.com%2Fmarc%5D=marc21%5Ftest.xsl&pz:recordfilter%5Bz3950.indexdata.com%2Fmarc%5D=date http://localhost:9763/search.pz2?session=8&command=search&query=xyzzyz diff --git a/test/test_http_10.res b/test/test_http_10.res index 90fd4e3..7d0e680 100644 --- a/test/test_http_10.res +++ b/test/test_http_10.res @@ -1,6 +1,5 @@ - -OK +OK 0 9 10 @@ -18,7 +17,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title the computer bible author medium book +content: title the computer bible author medium book @@ -31,7 +30,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title computer science technology author medium book +content: title computer science technology author medium book @@ -46,7 +45,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book +content: title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book @@ -59,7 +58,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title the use of passwords for controlled access to computer resources author wood helen m medium book +content: title the use of passwords for controlled access to computer resources author wood helen m medium book @@ -74,7 +73,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title computer processing of dynamic images from an anger scintillation camera author medium book +content: title computer processing of dynamic images from an anger scintillation camera author medium book @@ -92,7 +91,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title the puget sound region author mairs john w medium book +content: title the puget sound region author mairs john w medium book @@ -105,7 +104,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title a plan for community college computer development author medium book +content: title a plan for community college computer development author medium book @@ -122,7 +121,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title washington metropolitan area rail computer feasibility study author englund carl r medium book +content: title washington metropolitan area rail computer feasibility study author englund carl r medium book @@ -140,6 +139,6 @@ test-usersetting-2 data: YYYYYYYYY 2 -title how to program a computer author jack collins medium book +content: title how to program a computer author jack collins medium book - + \ No newline at end of file diff --git a/test/test_http_11.res b/test/test_http_11.res index 703dcfe..50799ac 100644 --- a/test/test_http_11.res +++ b/test/test_http_11.res @@ -1,6 +1,5 @@ - -OK +OK 0 9 10 @@ -17,7 +16,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title a plan for community college computer development author medium book +content: title a plan for community college computer development author medium book @@ -34,7 +33,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title washington metropolitan area rail computer feasibility study author englund carl r medium book +content: title washington metropolitan area rail computer feasibility study author englund carl r medium book @@ -48,7 +47,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title the computer bible author medium book +content: title the computer bible author medium book @@ -63,7 +62,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title computer processing of dynamic images from an anger scintillation camera author medium book +content: title computer processing of dynamic images from an anger scintillation camera author medium book @@ -81,7 +80,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title the puget sound region author mairs john w medium book +content: title the puget sound region author mairs john w medium book @@ -94,7 +93,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title computer science technology author medium book +content: title computer science technology author medium book @@ -109,7 +108,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book +content: title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book @@ -122,7 +121,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title the use of passwords for controlled access to computer resources author wood helen m medium book +content: title the use of passwords for controlled access to computer resources author wood helen m medium book @@ -140,6 +139,6 @@ test-usersetting-2 data: YYYYYYYYY 2 -title how to program a computer author jack collins medium book +content: title how to program a computer author jack collins medium book - + \ No newline at end of file diff --git a/test/test_http_13.res b/test/test_http_13.res index d3b889f..5a1147b 100644 --- a/test/test_http_13.res +++ b/test/test_http_13.res @@ -1,9 +1,8 @@ - -OK +OK 0 0 0 0 0 - + \ No newline at end of file diff --git a/test/test_http_14.res b/test/test_http_14.res index d3b889f..5a1147b 100644 --- a/test/test_http_14.res +++ b/test/test_http_14.res @@ -1,9 +1,8 @@ - -OK +OK 0 0 0 0 0 - + \ No newline at end of file diff --git a/test/test_http_18.res b/test/test_http_18.res index 267fde6..0a48c50 100644 --- a/test/test_http_18.res +++ b/test/test_http_18.res @@ -1,6 +1,5 @@ - -OK +OK 0 3 3 @@ -16,7 +15,7 @@ test-usersetting-2 data: 9416 -title bibliography of maine geology author medium book +content: title bibliography of maine geology author medium book @@ -28,7 +27,7 @@ test-usersetting-2 data: 0 -title groundwater resource maps county series author medium book +content: title groundwater resource maps county series author medium book @@ -40,6 +39,6 @@ test-usersetting-2 data: 0 -title oil gas drilling author medium book +content: title oil gas drilling author medium book - + \ No newline at end of file diff --git a/test/test_http_23.res b/test/test_http_23.res index a3476cd..8845b1a 100644 --- a/test/test_http_23.res +++ b/test/test_http_23.res @@ -1,7 +1,7 @@ -title how to program a computer author jack collins medium book -title computer processing of dynamic images from an anger scintillation camera author medium book +content: title how to program a computer author jack collins medium book +content: title computer processing of dynamic images from an anger scintillation camera author medium book 0 How to program a computer @@ -23,4 +23,4 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY - + \ No newline at end of file diff --git a/test/test_http_28.res b/test/test_http_28.res index fdb5227..bca8ca8 100644 --- a/test/test_http_28.res +++ b/test/test_http_28.res @@ -1,6 +1,5 @@ - -OK +OK 0 3 17 @@ -11,20 +10,20 @@ UTAH GEOCHROMOMETRY UTAH GEOCHROMOMETRY 300000 -title utah geochromometry author medium book +content: title utah geochromometry author medium book UTAH EARTHQUAKE EPICENTERS UTAH EARTHQUAKE EPICENTERS 200000 -title utah earthquake epicenters author medium book +content: title utah earthquake epicenters author medium book UTAH GEOLOGICAL AND MINERAL SURVEY PUBLICATIONS UTAH GEOLOGICAL AND MINERAL SURVEY PUBLICATIONS 100000 -title utah geological and mineral survey publications author medium book +content: title utah geological and mineral survey publications author medium book - + \ No newline at end of file diff --git a/test/test_http_32.res b/test/test_http_32.res index 5c85987..d1e8a82 100644 --- a/test/test_http_32.res +++ b/test/test_http_32.res @@ -1,6 +1,5 @@ - -OK +OK 0 3 3 @@ -13,7 +12,7 @@ BIBLIOGRAPHY OF MAINE GEOLOGY This data base is a computer based bibliography of marine geology. It allows searching by topic and geographic location, similar to GEOREF. It is currently under development to replace the printed Bibliography of Marine Geology 9416 -title bibliography of maine geology +content: title bibliography of maine geology @@ -22,7 +21,7 @@ GROUNDWATER RESOURCE MAPS - COUNTY SERIES A series of 1:250,000 scale maps showing well yield, well depth, and depth to bedrock for a large number of bedrock wells inventoried by the Maine Geological Survey in the mid-to late 1970's comprises this data set. Some series also show bedrock topography and potentiometric surface. Geographic coverage is restricted to Southern Maine 0 -title groundwater resource maps county series +content: title groundwater resource maps county series @@ -31,6 +30,6 @@ OIL/GAS DRILLING This database contains information on oil and gas drilling such as well name, operator, driller, location, depth, copies of logs run, permits, samples (cuttings, core), completion records 0 -title oil gas drilling +content: title oil gas drilling - + \ No newline at end of file diff --git a/test/test_http_36.res b/test/test_http_36.res index 6905e5a..e8ead75 100644 --- a/test/test_http_36.res +++ b/test/test_http_36.res @@ -1,6 +1,5 @@ - -OK +OK 0 8 10 @@ -18,7 +17,7 @@ test-usersetting-2 data: YYYYYYYYY 26706 -title computer science technology author medium book +content: title computer science technology author medium book @@ -33,7 +32,7 @@ test-usersetting-2 data: YYYYYYYYY 26706 -title the computer bible author medium book +content: title the computer bible author medium book @@ -47,7 +46,7 @@ test-usersetting-2 data: YYYYYYYYY 11445 -title a plan for community college computer development author medium book +content: title a plan for community college computer development author medium book @@ -65,7 +64,7 @@ test-usersetting-2 data: YYYYYYYYY 11445 -title washington metropolitan area rail computer feasibility study author englund carl r medium book +content: title washington metropolitan area rail computer feasibility study author englund carl r medium book @@ -84,7 +83,7 @@ test-usersetting-2 data: YYYYYYYYY 11127 -title the puget sound region author mairs john w medium book +content: title the puget sound region author mairs john w medium book @@ -100,7 +99,7 @@ test-usersetting-2 data: YYYYYYYYY 8011 -title computer processing of dynamic images from an anger scintillation camera author medium book +content: title computer processing of dynamic images from an anger scintillation camera author medium book @@ -114,7 +113,7 @@ test-usersetting-2 data: YYYYYYYYY 8011 -title the use of passwords for controlled access to computer resources author wood helen m medium book +content: title the use of passwords for controlled access to computer resources author wood helen m medium book @@ -130,6 +129,6 @@ test-usersetting-2 data: YYYYYYYYY 0 -title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book +content: title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book - + \ No newline at end of file diff --git a/test/test_http_41.res b/test/test_http_41.res index ac7cb04..cc72d29 100644 --- a/test/test_http_41.res +++ b/test/test_http_41.res @@ -1,6 +1,5 @@ - -OK +OK 0 8 31 @@ -11,55 +10,55 @@ APPLIED GEOLOGY FILE APPLIED GEOLOGY FILE 0 -title applied geology file author medium book +content: title applied geology file author medium book ELECTRIC LOG LIBRARY ELECTRIC LOG LIBRARY 0 -title electric log library author medium book +content: title electric log library author medium book ISOTOPIC DATES OF ROCKS AND MINERALS ISOTOPIC DATES OF ROCKS AND MINERALS 0 -title isotopic dates of rocks and minerals author medium book +content: title isotopic dates of rocks and minerals author medium book MINE MAP INDEX MINE MAP INDEX 0 -title mine map index author medium book +content: title mine map index author medium book UTAH CRIB FILE UTAH CRIB FILE 0 -title utah crib file author medium book +content: title utah crib file author medium book UTAH EARTHQUAKE EPICENTERS UTAH EARTHQUAKE EPICENTERS 0 -title utah earthquake epicenters author medium book +content: title utah earthquake epicenters author medium book UTAH GEOLOGIC MAP BIBLIOGRAPHY UTAH GEOLOGIC MAP BIBLIOGRAPHY 0 -title utah geologic map bibliography author medium book +content: title utah geologic map bibliography author medium book UTAH GEOLOGICAL AND MINERAL SURVEY PUBLICATIONS UTAH GEOLOGICAL AND MINERAL SURVEY PUBLICATIONS 0 -title utah geological and mineral survey publications author medium book +content: title utah geological and mineral survey publications author medium book - + \ No newline at end of file diff --git a/test/test_http_42.res b/test/test_http_42.res index 9893c49..67eb248 100644 --- a/test/test_http_42.res +++ b/test/test_http_42.res @@ -1,6 +1,5 @@ - -OK +OK 0 5 12 @@ -21,7 +20,7 @@ test-usersetting-2 data: YYYYYYYYY 174545 -title the religious teachers of greece author adam james medium book +content: title the religious teachers of greece author adam james medium book @@ -40,7 +39,7 @@ test-usersetting-2 data: YYYYYYYYY 150000 -title the puget sound region author mairs john w medium book +content: title the puget sound region author mairs john w medium book @@ -56,7 +55,7 @@ test-usersetting-2 data: YYYYYYYYY 125000 -title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book +content: title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book @@ -70,7 +69,7 @@ test-usersetting-2 data: YYYYYYYYY 60000 -title the use of passwords for controlled access to computer resources author wood helen m medium book +content: title the use of passwords for controlled access to computer resources author wood helen m medium book @@ -84,6 +83,6 @@ test-usersetting-2 data: YYYYYYYYY 35714 -title computer science technology author medium book +content: title computer science technology author medium book - + \ No newline at end of file diff --git a/test/test_http_45.res b/test/test_http_45.res index 2b89580..f4f9579 100644 --- a/test/test_http_45.res +++ b/test/test_http_45.res @@ -1,6 +1,5 @@ - -OK +OK 0 1 1 @@ -20,6 +19,6 @@ test-usersetting-2 data: YYYYYYYYY 0 -title computer processing of dynamic images from an anger scintillation camera author medium book +content: title computer processing of dynamic images from an anger scintillation camera author medium book - + \ No newline at end of file diff --git a/test/test_http_49.res b/test/test_http_49.res index 43fcf8b..ecb7374 100644 --- a/test/test_http_49.res +++ b/test/test_http_49.res @@ -1,6 +1,5 @@ - -OK +OK 0 1 1 @@ -21,6 +20,6 @@ test-usersetting-2 data: YYYYYYYYY 120000 -title the religious teachers of greece author adam james medium book +content: title the religious teachers of greece author adam james medium book - + \ No newline at end of file diff --git a/test/test_http_5.res b/test/test_http_5.res index a884f56..1c1d8d3 100644 --- a/test/test_http_5.res +++ b/test/test_http_5.res @@ -1,6 +1,5 @@ - -OK +OK 0 9 10 @@ -23,7 +22,7 @@ YYYYYYYYY 2 25286 -title how to program a computer author jack collins medium book +content: title how to program a computer author jack collins medium book @@ -37,7 +36,7 @@ test-usersetting-2 data: YYYYYYYYY 21072 -title computer science technology author medium book +content: title computer science technology author medium book @@ -52,7 +51,7 @@ test-usersetting-2 data: YYYYYYYYY 21072 -title the computer bible author medium book +content: title the computer bible author medium book @@ -66,7 +65,7 @@ test-usersetting-2 data: YYYYYYYYY 9030 -title a plan for community college computer development author medium book +content: title a plan for community college computer development author medium book @@ -84,7 +83,7 @@ test-usersetting-2 data: YYYYYYYYY 9030 -title washington metropolitan area rail computer feasibility study author englund carl r medium book +content: title washington metropolitan area rail computer feasibility study author englund carl r medium book @@ -103,7 +102,7 @@ test-usersetting-2 data: YYYYYYYYY 8780 -title the puget sound region author mairs john w medium book +content: title the puget sound region author mairs john w medium book @@ -119,7 +118,7 @@ test-usersetting-2 data: YYYYYYYYY 6321 -title computer processing of dynamic images from an anger scintillation camera author medium book +content: title computer processing of dynamic images from an anger scintillation camera author medium book @@ -133,7 +132,7 @@ test-usersetting-2 data: YYYYYYYYY 6321 -title the use of passwords for controlled access to computer resources author wood helen m medium book +content: title the use of passwords for controlled access to computer resources author wood helen m medium book @@ -149,6 +148,6 @@ test-usersetting-2 data: YYYYYYYYY 0 -title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book +content: title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book - + \ No newline at end of file diff --git a/test/test_http_50.res b/test/test_http_50.res index 2b89580..f4f9579 100644 --- a/test/test_http_50.res +++ b/test/test_http_50.res @@ -1,6 +1,5 @@ - -OK +OK 0 1 1 @@ -20,6 +19,6 @@ test-usersetting-2 data: YYYYYYYYY 0 -title computer processing of dynamic images from an anger scintillation camera author medium book +content: title computer processing of dynamic images from an anger scintillation camera author medium book - + \ No newline at end of file diff --git a/test/test_http_55.res b/test/test_http_55.res index d3b889f..5a1147b 100644 --- a/test/test_http_55.res +++ b/test/test_http_55.res @@ -1,9 +1,8 @@ - -OK +OK 0 0 0 0 0 - + \ No newline at end of file diff --git a/test/test_http_57.res b/test/test_http_57.res index d3b889f..5a1147b 100644 --- a/test/test_http_57.res +++ b/test/test_http_57.res @@ -1,9 +1,8 @@ - -OK +OK 0 0 0 0 0 - + \ No newline at end of file diff --git a/test/test_http_6.res b/test/test_http_6.res index f079915..f2a707c 100644 --- a/test/test_http_6.res +++ b/test/test_http_6.res @@ -1,7 +1,7 @@ -title how to program a computer author jack collins medium book -title computer science technology author medium book +content: title how to program a computer author jack collins medium book +content: title computer science technology author medium book 0 How to program a computer @@ -23,4 +23,4 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY - + \ No newline at end of file diff --git a/test/test_http_60.res b/test/test_http_60.res index f6ca445..28b128f 100644 --- a/test/test_http_60.res +++ b/test/test_http_60.res @@ -1,6 +1,5 @@ - -OK +OK 0 1 1 @@ -21,6 +20,6 @@ test-usersetting-2 data: YYYYYYYYY 320000 -title the religious teachers of greece author adam james medium book +content: title the religious teachers of greece author adam james medium book - + \ No newline at end of file diff --git a/test/test_http_63.res b/test/test_http_63.res index 43fcf8b..ecb7374 100644 --- a/test/test_http_63.res +++ b/test/test_http_63.res @@ -1,6 +1,5 @@ - -OK +OK 0 1 1 @@ -21,6 +20,6 @@ test-usersetting-2 data: YYYYYYYYY 120000 -title the religious teachers of greece author adam james medium book +content: title the religious teachers of greece author adam james medium book - + \ No newline at end of file diff --git a/test/test_http_8.res b/test/test_http_8.res index 84feb43..5375925 100644 --- a/test/test_http_8.res +++ b/test/test_http_8.res @@ -1,6 +1,5 @@ - -OK +OK 0 9 10 @@ -21,7 +20,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title washington metropolitan area rail computer feasibility study author englund carl r medium book +content: title washington metropolitan area rail computer feasibility study author englund carl r medium book @@ -34,7 +33,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title the use of passwords for controlled access to computer resources author wood helen m medium book +content: title the use of passwords for controlled access to computer resources author wood helen m medium book @@ -49,7 +48,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book +content: title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book @@ -67,7 +66,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title the puget sound region author mairs john w medium book +content: title the puget sound region author mairs john w medium book @@ -80,7 +79,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title a plan for community college computer development author medium book +content: title a plan for community college computer development author medium book @@ -98,7 +97,7 @@ test-usersetting-2 data: YYYYYYYYY 2 -title how to program a computer author jack collins medium book +content: title how to program a computer author jack collins medium book @@ -111,7 +110,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title computer science technology author medium book +content: title computer science technology author medium book @@ -126,7 +125,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title computer processing of dynamic images from an anger scintillation camera author medium book +content: title computer processing of dynamic images from an anger scintillation camera author medium book @@ -140,6 +139,6 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title the computer bible author medium book +content: title the computer bible author medium book - + \ No newline at end of file diff --git a/test/test_http_9.res b/test/test_http_9.res index 407ac56..fcefa9b 100644 --- a/test/test_http_9.res +++ b/test/test_http_9.res @@ -1,6 +1,5 @@ - -OK +OK 0 9 10 @@ -18,7 +17,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title the computer bible author medium book +content: title the computer bible author medium book @@ -33,7 +32,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title computer processing of dynamic images from an anger scintillation camera author medium book +content: title computer processing of dynamic images from an anger scintillation camera author medium book @@ -46,7 +45,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title computer science technology author medium book +content: title computer science technology author medium book @@ -64,7 +63,7 @@ test-usersetting-2 data: YYYYYYYYY 2 -title how to program a computer author jack collins medium book +content: title how to program a computer author jack collins medium book @@ -77,7 +76,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title a plan for community college computer development author medium book +content: title a plan for community college computer development author medium book @@ -95,7 +94,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title the puget sound region author mairs john w medium book +content: title the puget sound region author mairs john w medium book @@ -110,7 +109,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book +content: title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book @@ -123,7 +122,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title the use of passwords for controlled access to computer resources author wood helen m medium book +content: title the use of passwords for controlled access to computer resources author wood helen m medium book @@ -140,6 +139,6 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title washington metropolitan area rail computer feasibility study author englund carl r medium book +content: title washington metropolitan area rail computer feasibility study author englund carl r medium book - + \ No newline at end of file diff --git a/test/test_icu_10.res b/test/test_icu_10.res index 00a481a..bf54b7a 100644 --- a/test/test_icu_10.res +++ b/test/test_icu_10.res @@ -1,5 +1,5 @@ - -0 + +0 z3950.indexdata.com/marc @@ -9,4 +9,4 @@ 0 - + \ No newline at end of file diff --git a/test/test_icu_4.res b/test/test_icu_4.res index 84feb43..5375925 100644 --- a/test/test_icu_4.res +++ b/test/test_icu_4.res @@ -1,6 +1,5 @@ - -OK +OK 0 9 10 @@ -21,7 +20,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title washington metropolitan area rail computer feasibility study author englund carl r medium book +content: title washington metropolitan area rail computer feasibility study author englund carl r medium book @@ -34,7 +33,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title the use of passwords for controlled access to computer resources author wood helen m medium book +content: title the use of passwords for controlled access to computer resources author wood helen m medium book @@ -49,7 +48,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book +content: title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book @@ -67,7 +66,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title the puget sound region author mairs john w medium book +content: title the puget sound region author mairs john w medium book @@ -80,7 +79,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title a plan for community college computer development author medium book +content: title a plan for community college computer development author medium book @@ -98,7 +97,7 @@ test-usersetting-2 data: YYYYYYYYY 2 -title how to program a computer author jack collins medium book +content: title how to program a computer author jack collins medium book @@ -111,7 +110,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title computer science technology author medium book +content: title computer science technology author medium book @@ -126,7 +125,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title computer processing of dynamic images from an anger scintillation camera author medium book +content: title computer processing of dynamic images from an anger scintillation camera author medium book @@ -140,6 +139,6 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title the computer bible author medium book +content: title the computer bible author medium book - + \ No newline at end of file diff --git a/test/test_icu_5.res b/test/test_icu_5.res index 407ac56..fcefa9b 100644 --- a/test/test_icu_5.res +++ b/test/test_icu_5.res @@ -1,6 +1,5 @@ - -OK +OK 0 9 10 @@ -18,7 +17,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title the computer bible author medium book +content: title the computer bible author medium book @@ -33,7 +32,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title computer processing of dynamic images from an anger scintillation camera author medium book +content: title computer processing of dynamic images from an anger scintillation camera author medium book @@ -46,7 +45,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title computer science technology author medium book +content: title computer science technology author medium book @@ -64,7 +63,7 @@ test-usersetting-2 data: YYYYYYYYY 2 -title how to program a computer author jack collins medium book +content: title how to program a computer author jack collins medium book @@ -77,7 +76,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title a plan for community college computer development author medium book +content: title a plan for community college computer development author medium book @@ -95,7 +94,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title the puget sound region author mairs john w medium book +content: title the puget sound region author mairs john w medium book @@ -110,7 +109,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book +content: title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book @@ -123,7 +122,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title the use of passwords for controlled access to computer resources author wood helen m medium book +content: title the use of passwords for controlled access to computer resources author wood helen m medium book @@ -140,6 +139,6 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title washington metropolitan area rail computer feasibility study author englund carl r medium book +content: title washington metropolitan area rail computer feasibility study author englund carl r medium book - + \ No newline at end of file diff --git a/test/test_icu_6.res b/test/test_icu_6.res index 90fd4e3..7d0e680 100644 --- a/test/test_icu_6.res +++ b/test/test_icu_6.res @@ -1,6 +1,5 @@ - -OK +OK 0 9 10 @@ -18,7 +17,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title the computer bible author medium book +content: title the computer bible author medium book @@ -31,7 +30,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title computer science technology author medium book +content: title computer science technology author medium book @@ -46,7 +45,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book +content: title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book @@ -59,7 +58,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title the use of passwords for controlled access to computer resources author wood helen m medium book +content: title the use of passwords for controlled access to computer resources author wood helen m medium book @@ -74,7 +73,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title computer processing of dynamic images from an anger scintillation camera author medium book +content: title computer processing of dynamic images from an anger scintillation camera author medium book @@ -92,7 +91,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title the puget sound region author mairs john w medium book +content: title the puget sound region author mairs john w medium book @@ -105,7 +104,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title a plan for community college computer development author medium book +content: title a plan for community college computer development author medium book @@ -122,7 +121,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title washington metropolitan area rail computer feasibility study author englund carl r medium book +content: title washington metropolitan area rail computer feasibility study author englund carl r medium book @@ -140,6 +139,6 @@ test-usersetting-2 data: YYYYYYYYY 2 -title how to program a computer author jack collins medium book +content: title how to program a computer author jack collins medium book - + \ No newline at end of file diff --git a/test/test_icu_7.res b/test/test_icu_7.res index 703dcfe..50799ac 100644 --- a/test/test_icu_7.res +++ b/test/test_icu_7.res @@ -1,6 +1,5 @@ - -OK +OK 0 9 10 @@ -17,7 +16,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title a plan for community college computer development author medium book +content: title a plan for community college computer development author medium book @@ -34,7 +33,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title washington metropolitan area rail computer feasibility study author englund carl r medium book +content: title washington metropolitan area rail computer feasibility study author englund carl r medium book @@ -48,7 +47,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title the computer bible author medium book +content: title the computer bible author medium book @@ -63,7 +62,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title computer processing of dynamic images from an anger scintillation camera author medium book +content: title computer processing of dynamic images from an anger scintillation camera author medium book @@ -81,7 +80,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title the puget sound region author mairs john w medium book +content: title the puget sound region author mairs john w medium book @@ -94,7 +93,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title computer science technology author medium book +content: title computer science technology author medium book @@ -109,7 +108,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book +content: title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book @@ -122,7 +121,7 @@ XXXXXXXXXX test-usersetting-2 data: YYYYYYYYY -title the use of passwords for controlled access to computer resources author wood helen m medium book +content: title the use of passwords for controlled access to computer resources author wood helen m medium book @@ -140,6 +139,6 @@ test-usersetting-2 data: YYYYYYYYY 2 -title how to program a computer author jack collins medium book +content: title how to program a computer author jack collins medium book - + \ No newline at end of file diff --git a/test/test_icu_8.res b/test/test_icu_8.res index b816997..80dde63 100644 --- a/test/test_icu_8.res +++ b/test/test_icu_8.res @@ -1,5 +1,5 @@ - -0 + +0 Jack Collins2 Englund, Carl R.1 @@ -18,4 +18,4 @@ Tomography1 Universities And Colleges1 - + \ No newline at end of file diff --git a/test/test_icu_9.res b/test/test_icu_9.res index f09bc0a..f03fbd3 100644 --- a/test/test_icu_9.res +++ b/test/test_icu_9.res @@ -1,6 +1,5 @@ - -OK +OK 0 9 10 @@ -18,7 +17,7 @@ test-usersetting-2 data: YYYYYYYYY 37929 -title the use of passwords for controlled access to computer resources author wood helen m medium book +content: title the use of passwords for controlled access to computer resources author wood helen m medium book @@ -37,7 +36,7 @@ YYYYYYYYY 2 25286 -title how to program a computer author jack collins medium book +content: title how to program a computer author jack collins medium book @@ -52,7 +51,7 @@ test-usersetting-2 data: YYYYYYYYY 21072 -title the computer bible author medium book +content: title the computer bible author medium book @@ -66,7 +65,7 @@ test-usersetting-2 data: YYYYYYYYY 15804 -title computer science technology author medium book +content: title computer science technology author medium book @@ -80,7 +79,7 @@ test-usersetting-2 data: YYYYYYYYY 9030 -title a plan for community college computer development author medium book +content: title a plan for community college computer development author medium book @@ -98,7 +97,7 @@ test-usersetting-2 data: YYYYYYYYY 9030 -title washington metropolitan area rail computer feasibility study author englund carl r medium book +content: title washington metropolitan area rail computer feasibility study author englund carl r medium book @@ -117,7 +116,7 @@ test-usersetting-2 data: YYYYYYYYY 8780 -title the puget sound region author mairs john w medium book +content: title the puget sound region author mairs john w medium book @@ -133,7 +132,7 @@ test-usersetting-2 data: YYYYYYYYY 6321 -title computer processing of dynamic images from an anger scintillation camera author medium book +content: title computer processing of dynamic images from an anger scintillation camera author medium book @@ -149,6 +148,6 @@ test-usersetting-2 data: YYYYYYYYY 0 -title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book +content: title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book - + \ No newline at end of file diff --git a/test/test_post_10.res b/test/test_post_10.res index 4ad81c0..9caed57 100644 --- a/test/test_post_10.res +++ b/test/test_post_10.res @@ -1,6 +1,5 @@ - -OK +OK 0 9 10 @@ -17,7 +16,7 @@ Jack Collins 2 25286 -title how to program a computer author jack collins medium book +content: title how to program a computer author jack collins medium book @@ -28,7 +27,7 @@ proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976 1977 21072 -title computer science technology author medium book +content: title computer science technology author medium book @@ -37,7 +36,7 @@ The Computer Bible 1973-1980 21072 -title the computer bible author medium book +content: title the computer bible author medium book @@ -46,7 +45,7 @@ A plan for community college computer development 1971 9030 -title a plan for community college computer development author medium book +content: title a plan for community college computer development author medium book @@ -59,7 +58,7 @@ 1971 Englund, Carl R 9030 -title washington metropolitan area rail computer feasibility study author englund carl r medium book +content: title washington metropolitan area rail computer feasibility study author englund carl r medium book @@ -72,7 +71,7 @@ 1974 Mairs, John W 8780 -title the puget sound region author mairs john w medium book +content: title the puget sound region author mairs john w medium book @@ -83,7 +82,7 @@ the proceedings of a workshop 1974 6321 -title computer processing of dynamic images from an anger scintillation camera author medium book +content: title computer processing of dynamic images from an anger scintillation camera author medium book @@ -94,7 +93,7 @@ 1977 Wood, Helen M 6321 -title the use of passwords for controlled access to computer resources author wood helen m medium book +content: title the use of passwords for controlled access to computer resources author wood helen m medium book @@ -105,6 +104,6 @@ proceedings of the workshop 1977 0 -title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book +content: title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book - + \ No newline at end of file diff --git a/test/test_post_8.res b/test/test_post_8.res index 4ad81c0..9caed57 100644 --- a/test/test_post_8.res +++ b/test/test_post_8.res @@ -1,6 +1,5 @@ - -OK +OK 0 9 10 @@ -17,7 +16,7 @@ Jack Collins 2 25286 -title how to program a computer author jack collins medium book +content: title how to program a computer author jack collins medium book @@ -28,7 +27,7 @@ proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976 1977 21072 -title computer science technology author medium book +content: title computer science technology author medium book @@ -37,7 +36,7 @@ The Computer Bible 1973-1980 21072 -title the computer bible author medium book +content: title the computer bible author medium book @@ -46,7 +45,7 @@ A plan for community college computer development 1971 9030 -title a plan for community college computer development author medium book +content: title a plan for community college computer development author medium book @@ -59,7 +58,7 @@ 1971 Englund, Carl R 9030 -title washington metropolitan area rail computer feasibility study author englund carl r medium book +content: title washington metropolitan area rail computer feasibility study author englund carl r medium book @@ -72,7 +71,7 @@ 1974 Mairs, John W 8780 -title the puget sound region author mairs john w medium book +content: title the puget sound region author mairs john w medium book @@ -83,7 +82,7 @@ the proceedings of a workshop 1974 6321 -title computer processing of dynamic images from an anger scintillation camera author medium book +content: title computer processing of dynamic images from an anger scintillation camera author medium book @@ -94,7 +93,7 @@ 1977 Wood, Helen M 6321 -title the use of passwords for controlled access to computer resources author wood helen m medium book +content: title the use of passwords for controlled access to computer resources author wood helen m medium book @@ -105,6 +104,6 @@ proceedings of the workshop 1977 0 -title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book +content: title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book - + \ No newline at end of file diff --git a/test/test_post_9.res b/test/test_post_9.res index e28d1a8..8b8d4ac 100644 --- a/test/test_post_9.res +++ b/test/test_post_9.res @@ -1,6 +1,5 @@ - -OK +OK 0 3 3 @@ -11,20 +10,20 @@ BIBLIOGRAPHY OF MAINE GEOLOGY BIBLIOGRAPHY OF MAINE GEOLOGY 0 -title bibliography of maine geology author medium book +content: title bibliography of maine geology author medium book GROUNDWATER RESOURCE MAPS - COUNTY SERIES GROUNDWATER RESOURCE MAPS - COUNTY SERIES 0 -title groundwater resource maps county series author medium book +content: title groundwater resource maps county series author medium book OIL/GAS DRILLING OIL/GAS DRILLING 0 -title oil gas drilling author medium book +content: title oil gas drilling author medium book - + \ No newline at end of file diff --git a/test/test_solr.urls b/test/test_solr.urls index 1ce919e..4518018 100644 --- a/test/test_solr.urls +++ b/test/test_solr.urls @@ -1,5 +1,5 @@ http://localhost:9763/search.pz2?command=init&clear=1 -http://localhost:9763/search.pz2?session=1&command=settings&pz%3Atermlist_term_count%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=10&use_url_proxy%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=0&pz%3Apiggyback%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=1&pz%3Apreferred%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=1&pz%3Acclmap%3Asu%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=1%3Dsubject&pz%3Asru%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=solr&use_thumbnails%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=0&pz%3Acclmap%3Adate%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=1%3Ddate&medium%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=web&pz%3Aname%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=ocs_test&pz%3Acclmap%3Aissn%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=u%3D8&pz%3Acclmap%3Ati%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=1%3Dtitle&pz%3Acclmap%3Aau%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=1%3Dauthor&pz%3Axslt%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=solr-pz2.xsl&pz%3Acclmap%3Aterm%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=1%3Dtext+s%3Dal&pz%3Acclmap%3Aisbn%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=1%3Disbn&pz%3Aqueryencoding%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=UTF-8&pz%3Aoption_recordfilter%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=remote +http://localhost:9763/search.pz2?session=1&command=settings&pz%3Atermlist_term_count%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=10&use_url_proxy%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=0&pz%3Apiggyback%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=1&pz%3Apreferred%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=1&pz%3Acclmap%3Asu%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=1%3Dsubject&pz%3Asru%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=solr&use_thumbnails%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=0&pz%3Acclmap%3Adate%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=1%3Ddate&medium%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=web&pz%3Aname%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=ocs_test&pz%3Acclmap%3Aissn%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=u%3D8&pz%3Acclmap%3Ati%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=1%3Dtitle&pz%3Acclmap%3Aau%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=1%3Dauthor&pz%3Axslt%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=solr-pz2.xsl&pz%3Acclmap%3Aterm%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=1%3Dtext+s%3Dal&pz%3Acclmap%3Aisbn%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=1%3Disbn&pz%3Aqueryencoding%5Bocs-test.indexdata.com%2Fsolr%2Fselect%5D=UTF-8 http://localhost:9763/search.pz2?session=1&command=search&query=water -1 http://localhost:9763/search.pz2?session=1&command=show&block=preferred +2 http://localhost:9763/search.pz2?session=1&command=show&block=preferred http://localhost:9763/search.pz2?session=1&command=termlist&name=xtargets%2Csubject%2Cauthor%2Cdate%2Cmedium diff --git a/test/test_solr_4.res b/test/test_solr_4.res index 406581f..6f89f6f 100644 --- a/test/test_solr_4.res +++ b/test/test_solr_4.res @@ -1,6 +1,5 @@ - -OK +OK 0 97 1995 @@ -17,7 +16,7 @@ De Villiers, Marq book 23233 -title water author de villiers marq medium book +content: title water author de villiers marq medium book @@ -36,7 +35,7 @@ book 2 21645 -title potable water and methods of detecting impurities author baker m n medium book +content: title potable water and methods of detecting impurities author baker m n medium book @@ -51,7 +50,7 @@ "Balochistan conservation strategy background paper"--T.p book 20202 -title water author majeed abdul medium book +content: title water author majeed abdul medium book @@ -67,7 +66,7 @@ Examines major environmental issues surrounding water, giving examples of attempts to solve global problems and sources for more information book 18501 -title water author grant pamela medium book +content: title water author grant pamela medium book @@ -82,7 +81,7 @@ Includes index book 18182 -title water law author fisher d e medium book +content: title water law author fisher d e medium book @@ -98,7 +97,7 @@ Includes index book 17576 -title a primer on fresh water medium book +content: title a primer on fresh water medium book @@ -111,7 +110,7 @@ Thresh, John Clough book 15152 -title water and water supplies author thresh john clough medium book +content: title water and water supplies author thresh john clough medium book @@ -132,7 +131,7 @@ book 2 15152 -title water quality assessment of the state water project medium book +content: title water quality assessment of the state water project medium book @@ -147,7 +146,7 @@ Mason, William Pitt book 15152 -title water supply author mason william pitt medium book +content: title water supply author mason william pitt medium book @@ -162,7 +161,7 @@ Farnham, Henry P book 14630 -title the law of waters and water rights author farnham henry p medium book +content: title the law of waters and water rights author farnham henry p medium book @@ -185,7 +184,7 @@ book 2 13675 -title water in press medium book +content: title water in press medium book @@ -200,7 +199,7 @@ "EPA Contract 68-C7-0011, work assignment 0-38." book 13636 -title regulations on the disposal of arsenic residuals from drinking water treatment plants medium book +content: title regulations on the disposal of arsenic residuals from drinking water treatment plants medium book @@ -215,7 +214,7 @@ "A joint publication of Legislative Environmental Policy Office, Environmental Quality Council [and] Montana University System, Water Center" book 13199 -title a guide to montana water quality regulation author bryan michelle medium book +content: title a guide to montana water quality regulation author bryan michelle medium book @@ -228,7 +227,7 @@ Collection of articles with reference to India book 13131 -title water technology management medium book +content: title water technology management medium book @@ -241,7 +240,7 @@ 2000 book 13054 -title methods of analysis by the u s geological survey national water quality laboratory medium book +content: title methods of analysis by the u s geological survey national water quality laboratory medium book @@ -256,7 +255,7 @@ "This document was developed for US Environmental Protection Agency, Region 10, Seattle Washington, with the Idaho Water Resources Institute, University of Idaho." book 13016 -title aquatic habitat indicators and their application to water quality objectives within the clean water act author bauer steve medium book +content: title aquatic habitat indicators and their application to water quality objectives within the clean water act author bauer steve medium book @@ -271,7 +270,7 @@ "March 1997." book 12929 -title an empirical analysis of water temperature and dissolved oxygen conditions in the red deer river author saffran karen anita medium book +content: title an empirical analysis of water temperature and dissolved oxygen conditions in the red deer river author saffran karen anita medium book @@ -285,7 +284,7 @@ "GI-252"--Cover book 12626 -title surface water quality monitoring procedures manual medium book +content: title surface water quality monitoring procedures manual medium book @@ -298,7 +297,7 @@ 1997 book 12323 -title international conference on management of drinking water resources chennai december medium book +content: title international conference on management of drinking water resources chennai december medium book @@ -309,6 +308,6 @@ 1998 book 12121 -title mercados e instituciones de aguas en bolivia medium book +content: title mercados e instituciones de aguas en bolivia medium book - + \ No newline at end of file diff --git a/test/test_solr_5.res b/test/test_solr_5.res index dd89fec..9d5251c 100644 --- a/test/test_solr_5.res +++ b/test/test_solr_5.res @@ -1,5 +1,5 @@ - -0 + +0 ocs-test.indexdata.com/solr/select @@ -64,4 +64,4 @@ book99 book (electronic)1 - + \ No newline at end of file diff --git a/test/test_turbomarcxml_4.res b/test/test_turbomarcxml_4.res index 3ed2d80..7a97754 100644 --- a/test/test_turbomarcxml_4.res +++ b/test/test_turbomarcxml_4.res @@ -1,6 +1,5 @@ - -OK +OK 0 3 3 @@ -20,7 +19,7 @@ under development to replace the printed Bibliography of Marine Geologytest-usersetting-2 data: 9416 -title bibliography of maine geology author medium book +content: title bibliography of maine geology author medium book @@ -40,7 +39,7 @@ restricted to Southern Maine test-usersetting-2 data: 0 -title groundwater resource maps county series author medium book +content: title groundwater resource maps county series author medium book @@ -56,6 +55,6 @@ operator, driller, location, depth, copies of logs run, permits, samples test-usersetting-2 data: 0 -title oil gas drilling author medium book +content: title oil gas drilling author medium book - + \ No newline at end of file diff --git a/test/test_turbomarcxml_7.res b/test/test_turbomarcxml_7.res index 5c85987..d1e8a82 100644 --- a/test/test_turbomarcxml_7.res +++ b/test/test_turbomarcxml_7.res @@ -1,6 +1,5 @@ - -OK +OK 0 3 3 @@ -13,7 +12,7 @@ BIBLIOGRAPHY OF MAINE GEOLOGY This data base is a computer based bibliography of marine geology. It allows searching by topic and geographic location, similar to GEOREF. It is currently under development to replace the printed Bibliography of Marine Geology 9416 -title bibliography of maine geology +content: title bibliography of maine geology @@ -22,7 +21,7 @@ GROUNDWATER RESOURCE MAPS - COUNTY SERIES A series of 1:250,000 scale maps showing well yield, well depth, and depth to bedrock for a large number of bedrock wells inventoried by the Maine Geological Survey in the mid-to late 1970's comprises this data set. Some series also show bedrock topography and potentiometric surface. Geographic coverage is restricted to Southern Maine 0 -title groundwater resource maps county series +content: title groundwater resource maps county series @@ -31,6 +30,6 @@ OIL/GAS DRILLING This database contains information on oil and gas drilling such as well name, operator, driller, location, depth, copies of logs run, permits, samples (cuttings, core), completion records 0 -title oil gas drilling +content: title oil gas drilling - + \ No newline at end of file diff --git a/test/test_url.cfg b/test/test_url.cfg new file mode 100644 index 0000000..881ee65 --- /dev/null +++ b/test/test_url.cfg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/test_url.sh b/test/test_url.sh new file mode 100755 index 0000000..dd6b88f --- /dev/null +++ b/test/test_url.sh @@ -0,0 +1,14 @@ +#!/bin/sh +# + +# srcdir might be set by make +srcdir=${srcdir:-"."} + +# Test using test_http.cfg +exec ${srcdir}/run_pazpar2.sh test_url + +# Local Variables: +# mode:shell-script +# sh-indentation: 2 +# sh-basic-offset: 4 +# End: diff --git a/test/test_url.urls b/test/test_url.urls new file mode 100644 index 0000000..d93248f --- /dev/null +++ b/test/test_url.urls @@ -0,0 +1,10 @@ +http://localhost:9763/search.pz2?command=init&clear=1&pz:elements%5Bmy%5D=F&pz:requestsyntax%5Bmy%5D=usmarc&pz:nativesyntax%5Bmy%5D=iso2709&pz:xslt%5Bmy%5D=marc21_test.xsl&pz:name%5Bmy%5D=marcserver&pz:url%5Bmy%5D=z3950.indexdata.com%2Fmarc +http://localhost:9763/search.pz2?session=1&command=search&query=computer +2 http://localhost:9763/search.pz2?session=1&command=show&block=1 +http://localhost:9763/search.pz2?session=1&command=settings&pz:url%5Bmy%5D=z3950.indexdata.com%2Fgils&pz:sortmap:title%5Bmy%5D=type7:title +http://localhost:9763/search.pz2?session=1&command=search&query=the&maxrecs=3 +2 http://localhost:9763/search.pz2?session=1&command=show&block=1 +2 http://localhost:9763/search.pz2?session=1&command=show&block=1&sort=title:1 +2 http://localhost:9763/search.pz2?session=1&command=show&block=1&sort=title:1 +2 http://localhost:9763/search.pz2?session=1&command=show&block=1&sort=title:0 +2 http://localhost:9763/search.pz2?session=1&command=show&block=1&sort=title:0 diff --git a/test/test_url_1.res b/test/test_url_1.res new file mode 100644 index 0000000..81ff9ff --- /dev/null +++ b/test/test_url_1.res @@ -0,0 +1,2 @@ + +OK11 \ No newline at end of file diff --git a/test/test_url_10.res b/test/test_url_10.res new file mode 100644 index 0000000..57aba5a --- /dev/null +++ b/test/test_url_10.res @@ -0,0 +1,71 @@ + +OK +0 +7 +31 +0 +7 + + +WATER WELL DATA +This database contains the following information on water wells in Nevada: driller's name, owner's name, location, formations encountered, lithologic descriptions, water level, and water quality +WATER WELL DATA +This database contains the following information on water wells in Nevada: driller's name, owner's name, location, formations encountered, lithologic descriptions, water level, and water quality +1930-PRESENT +content: title water well data author medium book + + + +UTAH GEOLOGIC MAP BIBLIOGRAPHY +This collection consists of theses, dissertations, and other unpublished maps as well as published maps of the geology of Utah. Some maps of the collection are xeroxed from limited collections. Cross-sections are included in set. Data file consists of map bibliography +UTAH GEOLOGIC MAP BIBLIOGRAPHY +This collection consists of theses, dissertations, and other unpublished maps as well as published maps of the geology of Utah. Some maps of the collection are xeroxed from limited collections. Cross-sections are included in set. Data file consists of map bibliography +-PRESENT +content: title utah geologic map bibliography author medium book + + + +UTAH GEOLOGICAL AND MINERAL SURVEY PUBLICATIONS +Publications of the Utah Geological and Mineral Survey include reports of investigation, special studies, bulletins, open-file reports, geologic map of Utah, publications of geological societies, geologic and oil and mineral maps, coal monographs, circulars, water resource bulletins, and reprints of articles +UTAH GEOLOGICAL AND MINERAL SURVEY PUBLICATIONS +Publications of the Utah Geological and Mineral Survey include reports of investigation, special studies, bulletins, open-file reports, geologic map of Utah, publications of geological societies, geologic and oil and mineral maps, coal monographs, circulars, water resource bulletins, and reprints of articles +-PRESENT +content: title utah geological and mineral survey publications author medium book + + + +UTAH EARTHQUAKE EPICENTERS +Five files of epicenter data arranged by date comprise this data set. These files are searchable by magnitude and longitude/latitude. Hardcopy of listing and plot of requested area available. Epicenter location and date, magnitude, and focal depth available +UTAH EARTHQUAKE EPICENTERS +Five files of epicenter data arranged by date comprise this data set. These files are searchable by magnitude and longitude/latitude. Hardcopy of listing and plot of requested area available. Epicenter location and date, magnitude, and focal depth available +-PRESENT +content: title utah earthquake epicenters author medium book + + + +BIBLIOGRAPHY OF MAINE GEOLOGY +This data base is a computer based bibliography of marine geology. It allows searching by topic and geographic location, similar to GEOREF. It is currently under development to replace the printed Bibliography of Marine Geology +BIBLIOGRAPHY OF MAINE GEOLOGY +This data base is a computer based bibliography of marine geology. It allows searching by topic and geographic location, similar to GEOREF. It is currently under development to replace the printed Bibliography of Marine Geology +1692-PRESENT +content: title bibliography of maine geology author medium book + + + +AUTOMATED FLOOD WARNING NETWORK +The new system will collect rainfall, temperature, soil moisture, wind speed and direction, humidity, and streamflow (above certain values) +AUTOMATED FLOOD WARNING NETWORK +The new system will collect rainfall, temperature, soil moisture, wind speed and direction, humidity, and streamflow (above certain values) +1982-PRESENT +content: title automated flood warning network author medium book + + + +APPLIED GEOLOGY FILE +Reports and memorandums completed by the Site Investigation Section comprise this data set. Subjects include geotechnical appraisal of public facility sites before and during construction and evaluations of hazardous waste problems +APPLIED GEOLOGY FILE +Reports and memorandums completed by the Site Investigation Section comprise this data set. Subjects include geotechnical appraisal of public facility sites before and during construction and evaluations of hazardous waste problems +1970-PRESENT +content: title applied geology file author medium book + + \ No newline at end of file diff --git a/test/test_url_2.res b/test/test_url_2.res new file mode 100644 index 0000000..ab63fe6 --- /dev/null +++ b/test/test_url_2.res @@ -0,0 +1,2 @@ + +OK \ No newline at end of file diff --git a/test/test_url_3.res b/test/test_url_3.res new file mode 100644 index 0000000..6ac87ef --- /dev/null +++ b/test/test_url_3.res @@ -0,0 +1,123 @@ + +OK +0 +9 +10 +0 +9 + + +How to program a computer +Jack Collins +How to program a computer +Jack Collins + +How to program a computer +Jack Collins +2 +25286 +content: title how to program a computer author jack collins medium book + + + +The Computer Bible +1973-1980 +Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates +The Computer Bible +1973-1980 +Hebrew and Greek; introductions in English +Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates +21072 +content: title the computer bible author medium book + + + +Computer science & technology +proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976 +1977 +Computer science & technology +proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976 +1977 +15804 +content: title computer science technology author medium book + + + +A plan for community college computer development +1971 +Cover title +A plan for community college computer development +1971 +Cover title +9030 +content: title a plan for community college computer development author medium book + + + +Washington metropolitan area rail computer feasibility study; +final report +1971 +Englund, Carl R +"Contract DOT-UT-10003." +Washington metropolitan area rail computer feasibility study; +final report +1971 +Englund, Carl R +"Contract DOT-UT-10003." +9030 +content: title washington metropolitan area rail computer feasibility study author englund carl r medium book + + + +The Puget Sound Region +a portfolio of thematic computer maps +1974 +Mairs, John W +Scale of maps ca. 1:1,000,000 +The Puget Sound Region +a portfolio of thematic computer maps +1974 +Mairs, John W +Scale of maps ca. 1:1,000,000 +Bibliography: p. 4 +8780 +content: title the puget sound region author mairs john w medium book + + + +Computer processing of dynamic images from an Anger scintillation camera +the proceedings of a workshop +1974 +Includes bibliographical references and index +Computer processing of dynamic images from an Anger scintillation camera +the proceedings of a workshop +1974 +Includes bibliographical references and index +6321 +content: title computer processing of dynamic images from an anger scintillation camera author medium book + + + +The use of passwords for controlled access to computer resources +1977 +Wood, Helen M +The use of passwords for controlled access to computer resources +1977 +Wood, Helen M +6321 +content: title the use of passwords for controlled access to computer resources author wood helen m medium book + + + +Reconstruction tomography in diagnostic radiology and nuclear medicine +proceedings of the workshop +1977 +Includes bibliographical references and index +Reconstruction tomography in diagnostic radiology and nuclear medicine +proceedings of the workshop +1977 +Includes bibliographical references and index +0 +content: title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book + + \ No newline at end of file diff --git a/test/test_url_4.res b/test/test_url_4.res new file mode 100644 index 0000000..42534e3 --- /dev/null +++ b/test/test_url_4.res @@ -0,0 +1,2 @@ + +OK \ No newline at end of file diff --git a/test/test_url_5.res b/test/test_url_5.res new file mode 100644 index 0000000..ab63fe6 --- /dev/null +++ b/test/test_url_5.res @@ -0,0 +1,2 @@ + +OK \ No newline at end of file diff --git a/test/test_url_6.res b/test/test_url_6.res new file mode 100644 index 0000000..e0de11a --- /dev/null +++ b/test/test_url_6.res @@ -0,0 +1,38 @@ + +OK +0 +3 +31 +0 +3 + + +APPLIED GEOLOGY FILE +Reports and memorandums completed by the Site Investigation Section comprise this data set. Subjects include geotechnical appraisal of public facility sites before and during construction and evaluations of hazardous waste problems +APPLIED GEOLOGY FILE +Reports and memorandums completed by the Site Investigation Section comprise this data set. Subjects include geotechnical appraisal of public facility sites before and during construction and evaluations of hazardous waste problems +1970-PRESENT +3923 +content: title applied geology file author medium book + + + +UTAH GEOLOGICAL AND MINERAL SURVEY PUBLICATIONS +Publications of the Utah Geological and Mineral Survey include reports of investigation, special studies, bulletins, open-file reports, geologic map of Utah, publications of geological societies, geologic and oil and mineral maps, coal monographs, circulars, water resource bulletins, and reprints of articles +UTAH GEOLOGICAL AND MINERAL SURVEY PUBLICATIONS +Publications of the Utah Geological and Mineral Survey include reports of investigation, special studies, bulletins, open-file reports, geologic map of Utah, publications of geological societies, geologic and oil and mineral maps, coal monographs, circulars, water resource bulletins, and reprints of articles +-PRESENT +2896 +content: title utah geological and mineral survey publications author medium book + + + +UTAH EARTHQUAKE EPICENTERS +Five files of epicenter data arranged by date comprise this data set. These files are searchable by magnitude and longitude/latitude. Hardcopy of listing and plot of requested area available. Epicenter location and date, magnitude, and focal depth available +UTAH EARTHQUAKE EPICENTERS +Five files of epicenter data arranged by date comprise this data set. These files are searchable by magnitude and longitude/latitude. Hardcopy of listing and plot of requested area available. Epicenter location and date, magnitude, and focal depth available +-PRESENT +0 +content: title utah earthquake epicenters author medium book + + \ No newline at end of file diff --git a/test/test_url_7.res b/test/test_url_7.res new file mode 100644 index 0000000..ef31ae5 --- /dev/null +++ b/test/test_url_7.res @@ -0,0 +1,53 @@ + +OK +0 +5 +31 +0 +5 + + +APPLIED GEOLOGY FILE +Reports and memorandums completed by the Site Investigation Section comprise this data set. Subjects include geotechnical appraisal of public facility sites before and during construction and evaluations of hazardous waste problems +APPLIED GEOLOGY FILE +Reports and memorandums completed by the Site Investigation Section comprise this data set. Subjects include geotechnical appraisal of public facility sites before and during construction and evaluations of hazardous waste problems +1970-PRESENT +content: title applied geology file author medium book + + + +AUTOMATED FLOOD WARNING NETWORK +The new system will collect rainfall, temperature, soil moisture, wind speed and direction, humidity, and streamflow (above certain values) +AUTOMATED FLOOD WARNING NETWORK +The new system will collect rainfall, temperature, soil moisture, wind speed and direction, humidity, and streamflow (above certain values) +1982-PRESENT +content: title automated flood warning network author medium book + + + +BIBLIOGRAPHY OF MAINE GEOLOGY +This data base is a computer based bibliography of marine geology. It allows searching by topic and geographic location, similar to GEOREF. It is currently under development to replace the printed Bibliography of Marine Geology +BIBLIOGRAPHY OF MAINE GEOLOGY +This data base is a computer based bibliography of marine geology. It allows searching by topic and geographic location, similar to GEOREF. It is currently under development to replace the printed Bibliography of Marine Geology +1692-PRESENT +content: title bibliography of maine geology author medium book + + + +UTAH EARTHQUAKE EPICENTERS +Five files of epicenter data arranged by date comprise this data set. These files are searchable by magnitude and longitude/latitude. Hardcopy of listing and plot of requested area available. Epicenter location and date, magnitude, and focal depth available +UTAH EARTHQUAKE EPICENTERS +Five files of epicenter data arranged by date comprise this data set. These files are searchable by magnitude and longitude/latitude. Hardcopy of listing and plot of requested area available. Epicenter location and date, magnitude, and focal depth available +-PRESENT +content: title utah earthquake epicenters author medium book + + + +UTAH GEOLOGICAL AND MINERAL SURVEY PUBLICATIONS +Publications of the Utah Geological and Mineral Survey include reports of investigation, special studies, bulletins, open-file reports, geologic map of Utah, publications of geological societies, geologic and oil and mineral maps, coal monographs, circulars, water resource bulletins, and reprints of articles +UTAH GEOLOGICAL AND MINERAL SURVEY PUBLICATIONS +Publications of the Utah Geological and Mineral Survey include reports of investigation, special studies, bulletins, open-file reports, geologic map of Utah, publications of geological societies, geologic and oil and mineral maps, coal monographs, circulars, water resource bulletins, and reprints of articles +-PRESENT +content: title utah geological and mineral survey publications author medium book + + \ No newline at end of file diff --git a/test/test_url_8.res b/test/test_url_8.res new file mode 100644 index 0000000..ef31ae5 --- /dev/null +++ b/test/test_url_8.res @@ -0,0 +1,53 @@ + +OK +0 +5 +31 +0 +5 + + +APPLIED GEOLOGY FILE +Reports and memorandums completed by the Site Investigation Section comprise this data set. Subjects include geotechnical appraisal of public facility sites before and during construction and evaluations of hazardous waste problems +APPLIED GEOLOGY FILE +Reports and memorandums completed by the Site Investigation Section comprise this data set. Subjects include geotechnical appraisal of public facility sites before and during construction and evaluations of hazardous waste problems +1970-PRESENT +content: title applied geology file author medium book + + + +AUTOMATED FLOOD WARNING NETWORK +The new system will collect rainfall, temperature, soil moisture, wind speed and direction, humidity, and streamflow (above certain values) +AUTOMATED FLOOD WARNING NETWORK +The new system will collect rainfall, temperature, soil moisture, wind speed and direction, humidity, and streamflow (above certain values) +1982-PRESENT +content: title automated flood warning network author medium book + + + +BIBLIOGRAPHY OF MAINE GEOLOGY +This data base is a computer based bibliography of marine geology. It allows searching by topic and geographic location, similar to GEOREF. It is currently under development to replace the printed Bibliography of Marine Geology +BIBLIOGRAPHY OF MAINE GEOLOGY +This data base is a computer based bibliography of marine geology. It allows searching by topic and geographic location, similar to GEOREF. It is currently under development to replace the printed Bibliography of Marine Geology +1692-PRESENT +content: title bibliography of maine geology author medium book + + + +UTAH EARTHQUAKE EPICENTERS +Five files of epicenter data arranged by date comprise this data set. These files are searchable by magnitude and longitude/latitude. Hardcopy of listing and plot of requested area available. Epicenter location and date, magnitude, and focal depth available +UTAH EARTHQUAKE EPICENTERS +Five files of epicenter data arranged by date comprise this data set. These files are searchable by magnitude and longitude/latitude. Hardcopy of listing and plot of requested area available. Epicenter location and date, magnitude, and focal depth available +-PRESENT +content: title utah earthquake epicenters author medium book + + + +UTAH GEOLOGICAL AND MINERAL SURVEY PUBLICATIONS +Publications of the Utah Geological and Mineral Survey include reports of investigation, special studies, bulletins, open-file reports, geologic map of Utah, publications of geological societies, geologic and oil and mineral maps, coal monographs, circulars, water resource bulletins, and reprints of articles +UTAH GEOLOGICAL AND MINERAL SURVEY PUBLICATIONS +Publications of the Utah Geological and Mineral Survey include reports of investigation, special studies, bulletins, open-file reports, geologic map of Utah, publications of geological societies, geologic and oil and mineral maps, coal monographs, circulars, water resource bulletins, and reprints of articles +-PRESENT +content: title utah geological and mineral survey publications author medium book + + \ No newline at end of file diff --git a/test/test_url_9.res b/test/test_url_9.res new file mode 100644 index 0000000..57aba5a --- /dev/null +++ b/test/test_url_9.res @@ -0,0 +1,71 @@ + +OK +0 +7 +31 +0 +7 + + +WATER WELL DATA +This database contains the following information on water wells in Nevada: driller's name, owner's name, location, formations encountered, lithologic descriptions, water level, and water quality +WATER WELL DATA +This database contains the following information on water wells in Nevada: driller's name, owner's name, location, formations encountered, lithologic descriptions, water level, and water quality +1930-PRESENT +content: title water well data author medium book + + + +UTAH GEOLOGIC MAP BIBLIOGRAPHY +This collection consists of theses, dissertations, and other unpublished maps as well as published maps of the geology of Utah. Some maps of the collection are xeroxed from limited collections. Cross-sections are included in set. Data file consists of map bibliography +UTAH GEOLOGIC MAP BIBLIOGRAPHY +This collection consists of theses, dissertations, and other unpublished maps as well as published maps of the geology of Utah. Some maps of the collection are xeroxed from limited collections. Cross-sections are included in set. Data file consists of map bibliography +-PRESENT +content: title utah geologic map bibliography author medium book + + + +UTAH GEOLOGICAL AND MINERAL SURVEY PUBLICATIONS +Publications of the Utah Geological and Mineral Survey include reports of investigation, special studies, bulletins, open-file reports, geologic map of Utah, publications of geological societies, geologic and oil and mineral maps, coal monographs, circulars, water resource bulletins, and reprints of articles +UTAH GEOLOGICAL AND MINERAL SURVEY PUBLICATIONS +Publications of the Utah Geological and Mineral Survey include reports of investigation, special studies, bulletins, open-file reports, geologic map of Utah, publications of geological societies, geologic and oil and mineral maps, coal monographs, circulars, water resource bulletins, and reprints of articles +-PRESENT +content: title utah geological and mineral survey publications author medium book + + + +UTAH EARTHQUAKE EPICENTERS +Five files of epicenter data arranged by date comprise this data set. These files are searchable by magnitude and longitude/latitude. Hardcopy of listing and plot of requested area available. Epicenter location and date, magnitude, and focal depth available +UTAH EARTHQUAKE EPICENTERS +Five files of epicenter data arranged by date comprise this data set. These files are searchable by magnitude and longitude/latitude. Hardcopy of listing and plot of requested area available. Epicenter location and date, magnitude, and focal depth available +-PRESENT +content: title utah earthquake epicenters author medium book + + + +BIBLIOGRAPHY OF MAINE GEOLOGY +This data base is a computer based bibliography of marine geology. It allows searching by topic and geographic location, similar to GEOREF. It is currently under development to replace the printed Bibliography of Marine Geology +BIBLIOGRAPHY OF MAINE GEOLOGY +This data base is a computer based bibliography of marine geology. It allows searching by topic and geographic location, similar to GEOREF. It is currently under development to replace the printed Bibliography of Marine Geology +1692-PRESENT +content: title bibliography of maine geology author medium book + + + +AUTOMATED FLOOD WARNING NETWORK +The new system will collect rainfall, temperature, soil moisture, wind speed and direction, humidity, and streamflow (above certain values) +AUTOMATED FLOOD WARNING NETWORK +The new system will collect rainfall, temperature, soil moisture, wind speed and direction, humidity, and streamflow (above certain values) +1982-PRESENT +content: title automated flood warning network author medium book + + + +APPLIED GEOLOGY FILE +Reports and memorandums completed by the Site Investigation Section comprise this data set. Subjects include geotechnical appraisal of public facility sites before and during construction and evaluations of hazardous waste problems +APPLIED GEOLOGY FILE +Reports and memorandums completed by the Site Investigation Section comprise this data set. Subjects include geotechnical appraisal of public facility sites before and during construction and evaluations of hazardous waste problems +1970-PRESENT +content: title applied geology file author medium book + + \ No newline at end of file diff --git a/win/makefile b/win/makefile index 22aa704..adf52b4 100644 --- a/win/makefile +++ b/win/makefile @@ -191,7 +191,6 @@ PAZPAR2_OBJS = \ "$(OBJDIR)\normalize7bit.obj" \ "$(OBJDIR)\database.obj" \ "$(OBJDIR)\settings.obj" \ - "$(OBJDIR)\getaddrinfo.obj" \ "$(OBJDIR)\charsets.obj" \ "$(OBJDIR)\client.obj" \ "$(OBJDIR)\jenkins_hash.obj" \