<option id="gnu.c.compiler.macosx.exe.debug.option.debugging.level.88106198" name="Debug Level" superClass="gnu.c.compiler.macosx.exe.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
<option id="gnu.c.compiler.option.include.paths.16758435" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value=""${workspace_loc:/yaz/include}""/>
+ <listOptionValue builtIn="false" value="/usr/local/include"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1159745856" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
DEBIAN_DIST="wheezy squeeze lenny"
UBUNTU_DIST="natty maverick lucid karmic"
+VERSION=1.6.5
SUBDIRS = src test js doc
-EXTRA_DIST = $(PACKAGE).spec README NEWS LICENSE \
+EXTRA_DIST = $(PACKAGE).spec IDMETA README NEWS LICENSE \
buildconf.sh Doxyfile.in m4/yaz.m4 \
win/makefile win/version.nsi win/version.nsi.in win/license.txt
+For search, when limit and or filtering is in place and search
+is identical to previous search, the result set is re-used and the
+target is not searched.
+
+Limits may work perform local filtering as well, by using "local:"
+for a limitmap.
+
--- 1.6.5 2011/11/01
+
Updated bytarget command to contain a suggestions element with misspelled
words and suggestions to these. pz2.js has been updated to deliver this
onwards as well. Only target that currently delivers this is the solr
# Autoconf and automake setup
AC_PREREQ(2.60)
-AC_INIT([pazpar2],[1.6.5],[pazpar2-help@indexdata.dk])
+AC_INIT([pazpar2],
+m4_esyscmd([. ./IDMETA; echo $VERSION|tr -d '\n']),
+[pazpar2-help@indexdata.dk])
AC_CONFIG_HEADERS(src/config.h)
AC_C_INLINE
-YAZ_INIT([static icu],[4.2.18])
+YAZ_INIT([static icu],[4.2.20])
if test -z "$YAZLIB"; then
AC_MSG_ERROR([YAZ development libraries missing])
fi
Maintainer: Adam Dickmeiss <adam@indexdata.dk>
Build-Depends: debhelper (>= 5),
autotools-dev,
- libyaz4-dev (>= 4.2.18),
+ libyaz4-dev (>= 4.2.20),
docbook-xsl,
libgnutls-dev
Standards-Version: 3.7.2
<listitem>
<para>
Specifies attributes for limiting a search to a field - using
- the limit parameter for search. In some cases the mapping of
+ the limit parameter for search. It can be used to filter locally
+ or remotely (search in a target). In some cases the mapping of
a field to a value is identical to an existing cclmap field; in
other cases the field must be specified in a different way - for
example to match a complete field (rather than parts of a subfield).
</para>
<para>
- The value of limitmap may have one of two forms: referral to
- an exisiting CCL field or a raw PQF string. Leading string
- determines type; either <literal>ccl:</literal> for CCL field or
- <literal>rpn:</literal> for PQF/RPN.
+ The value of limitmap may have one of three forms: referral to
+ an existing CCL field, a raw PQF string or a local limit. Leading string
+ determines type; either <literal>ccl:</literal> for CCL field,
+ <literal>rpn:</literal> for PQF/RPN, or <literal>local:</literal>
+ for filtering in Pazpar2.
</para>
<note>
<para>
The limitmap facility is supported for Pazpar2 version 1.6.0.
+ Local filtering is supported in Pazpar2 1.6.6.
</para>
</note>
</listitem>
<xsl:param name="medium" />
+ <!--
+ According to cf/builder/templates/parseTask.cff, connectors can
+ also generate a "medium" field, but that is ignored in this
+ stylesheet, the rule below instead using an XSLT parameter.
+ Should the data element be used in preference when it is included?
+ -->
+
<xsl:template match="/record">
<pz:record>
<pz:metadata type="medium">
</pz:metadata>
</xsl:template>
+ <!--
+ According to cf/builder/templates/parseTask.cff, connectors can
+ also generate a "holding" field, but it's not clear how that is
+ different from "item". Perhaps this "item" rule should also
+ handle "holding" in the same way?
+ -->
+
<xsl:template match="item">
<pz:metadata type="locallocation">
<xsl:choose>
</pz:metadata>
</xsl:template>
+ <xsl:template match="available">
+ <pz:metadata type="available">
+ <xsl:value-of select="."/>
+ </pz:metadata>
+ </xsl:template>
+
+ <xsl:template match="citation">
+ <pz:metadata type="citation">
+ <xsl:value-of select="."/>
+ </pz:metadata>
+ </xsl:template>
+
+ <xsl:template match="relevance">
+ <pz:metadata type="relevance">
+ <xsl:value-of select="."/>
+ </pz:metadata>
+ </xsl:template>
+
+ <xsl:template match="booktitle">
+ <pz:metadata type="booktitle">
+ <xsl:value-of select="."/>
+ </pz:metadata>
+ </xsl:template>
+
+ <xsl:template match="copyright">
+ <pz:metadata type="copyright">
+ <xsl:value-of select="."/>
+ </pz:metadata>
+ </xsl:template>
+
+ <xsl:template match="copyrightabstract">
+ <pz:metadata type="copyrightabstract">
+ <xsl:value-of select="."/>
+ </pz:metadata>
+ </xsl:template>
+
+ <xsl:template match="pubtype">
+ <pz:metadata type="pubtype">
+ <xsl:value-of select="."/>
+ </pz:metadata>
+ </xsl:template>
+
+ <xsl:template match="doctype">
+ <pz:metadata type="doctype">
+ <xsl:value-of select="."/>
+ </pz:metadata>
+ </xsl:template>
+
+ <xsl:template match="extent">
+ <pz:metadata type="extent">
+ <xsl:value-of select="."/>
+ </pz:metadata>
+ </xsl:template>
+
+ <xsl:template match="format">
+ <pz:metadata type="format">
+ <xsl:value-of select="."/>
+ </pz:metadata>
+ </xsl:template>
+
+ <xsl:template match="languageitem">
+ <pz:metadata type="languageitem">
+ <xsl:value-of select="."/>
+ </pz:metadata>
+ </xsl:template>
+
+ <xsl:template match="languageabstract">
+ <pz:metadata type="languageabstract">
+ <xsl:value-of select="."/>
+ </pz:metadata>
+ </xsl:template>
+
+ <xsl:template match="permalink">
+ <pz:metadata type="permalink">
+ <xsl:value-of select="."/>
+ </pz:metadata>
+ </xsl:template>
+
+ <xsl:template match="*" >
+ <pz:metadata type="{local-name()}">
+ <xsl:value-of select="."/>
+ </pz:metadata>
+ </xsl:template>
+
<xsl:template match="text()"/>
</xsl:stylesheet>
-<settings target="opencontent-solr.index:8984/solr">
+<settings target="ocs-test.indexdata.com/solr/select">
<set name="pz:name" value="opencontent-solr"/>
<set name="pz:apdulog" value="1"/>
+%define idmetaversion %(. ./IDMETA; echo $VERSION|tr -d '\n')
Summary: Metasearcher
Name: pazpar2
-Version: 1.6.5
+Version: %{idmetaversion}
Release: 1indexdata
License: GPL
Group: Applications/Internet
database.c database.h \
eventl.c eventl.h \
facet_limit.c facet_limit.h \
- host.h \
+ getaddrinfo.c \
+ host.c host.h \
http.c http.h http_command.c \
incref.c incref.h \
jenkins_hash.c jenkins_hash.h \
YAZ_MUTEX mutex;
int ref_count;
char *id;
+ facet_limits_t facet_limits;
};
struct suggestions {
struct session *se = cl->session;
if (se)
{
- client_unlock(cl);
- session_alert_watch(se, SESSION_WATCH_SHOW);
- session_alert_watch(se, SESSION_WATCH_BYTARGET);
- session_alert_watch(se, SESSION_WATCH_TERMLIST);
- session_alert_watch(se, SESSION_WATCH_RECORD);
- client_lock(cl);
+ if (reclist_get_num_records(se->reclist) > 0)
+ {
+ client_unlock(cl);
+ session_alert_watch(se, SESSION_WATCH_SHOW);
+ session_alert_watch(se, SESSION_WATCH_BYTARGET);
+ session_alert_watch(se, SESSION_WATCH_TERMLIST);
+ session_alert_watch(se, SESSION_WATCH_RECORD);
+ client_lock(cl);
+ }
+ }
+}
+
+static void client_record_ingest(struct client *cl)
+{
+ const char *msg, *addinfo;
+ ZOOM_record rec = 0;
+ ZOOM_resultset resultset = cl->resultset;
+ int offset = cl->record_offset;
+ if ((rec = ZOOM_resultset_record(resultset, offset)))
+ {
+ cl->record_offset++;
+ if (cl->session == 0)
+ ;
+ else if (ZOOM_record_error(rec, &msg, &addinfo, 0))
+ {
+ yaz_log(YLOG_WARN, "Record error %s (%s): %s (rec #%d)",
+ msg, addinfo, client_get_id(cl),
+ cl->record_offset);
+ }
+ else
+ {
+ struct session_database *sdb = client_get_database(cl);
+ NMEM nmem = nmem_create();
+ const char *xmlrec;
+ char type[80];
+
+ if (nativesyntax_to_type(sdb, type, rec))
+ yaz_log(YLOG_WARN, "Failed to determine record type");
+ xmlrec = ZOOM_record_get(rec, type, NULL);
+ if (!xmlrec)
+ yaz_log(YLOG_WARN, "ZOOM_record_get failed from %s",
+ 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_id(cl));
+ }
+ nmem_destroy(nmem);
+ }
+ }
+ else
+ {
+ yaz_log(YLOG_WARN, "Expected record, but got NULL, offset=%d",
+ offset);
}
}
}
else
{
- ZOOM_record rec = 0;
- const char *msg, *addinfo;
-
if (cl->show_raw && cl->show_raw->active)
{
+ ZOOM_record rec = 0;
if ((rec = ZOOM_resultset_record(resultset,
cl->show_raw->position-1)))
{
}
else
{
- int offset = cl->record_offset;
- if ((rec = ZOOM_resultset_record(resultset, offset)))
- {
- cl->record_offset++;
- if (cl->session == 0)
- ;
- else if (ZOOM_record_error(rec, &msg, &addinfo, 0))
- {
- yaz_log(YLOG_WARN, "Record error %s (%s): %s (rec #%d)",
- msg, addinfo, client_get_id(cl),
- cl->record_offset);
- }
- else
- {
- struct session_database *sdb = client_get_database(cl);
- NMEM nmem = nmem_create();
- const char *xmlrec;
- char type[80];
-
- if (nativesyntax_to_type(sdb, type, rec))
- yaz_log(YLOG_WARN, "Failed to determine record type");
- xmlrec = ZOOM_record_get(rec, type, NULL);
- if (!xmlrec)
- yaz_log(YLOG_WARN, "ZOOM_record_get failed from %s",
- 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_id(cl));
- }
- nmem_destroy(nmem);
- }
- }
- else
- {
- yaz_log(YLOG_WARN, "Expected record, but got NULL, offset=%d",
- offset);
- }
+ client_record_ingest(cl);
}
}
}
+void client_reingest(struct client *cl)
+{
+ int i = cl->startrecs;
+ int to = cl->record_offset;
+
+ cl->record_offset = i;
+ for (; i < to; i++)
+ client_record_ingest(cl);
+}
+
static void client_set_facets_request(struct client *cl, ZOOM_connection link)
{
struct session_database *sdb = client_get_database(cl);
return 0;
}
-void client_start_search(struct client *cl, const char *sort_strategy_and_spec,
- int increasing)
+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 client_start_search(struct client *cl)
{
struct session_database *sdb = client_get_database(cl);
struct connection *co = client_get_connection(cl);
ZOOM_connection link = connection_get_link(co);
+ struct session *se = client_get_session(cl);
ZOOM_resultset rs;
const char *opt_piggyback = session_setting_oneval(sdb, PZ_PIGGYBACK);
const char *opt_queryenc = session_setting_oneval(sdb, PZ_QUERYENCODING);
assert(link);
- cl->record_offset = 0;
cl->diagnostic = 0;
if (extra_args && *extra_args)
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)
+ if (se->sorted_results)
+ { /* first entry is current sorting ! */
+ const char *sort_strategy_and_spec =
+ get_strategy_plus_sort(cl, se->sorted_results->field);
+ int increasing = se->sorted_results->increasing;
+ if (sort_strategy_and_spec && strlen(sort_strategy_and_spec) < 40)
{
- *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);
+ 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);
+ }
+ }
+ else
+ {
+ /* no native sorting.. If this is not the first search, then
+ skip it entirely */
+ if (se->sorted_results->next)
+ {
+ ZOOM_query_destroy(q);
+ client_set_state_nb(cl, Client_Idle);
+ return;
+ }
}
}
+ cl->hits = 0;
+ cl->record_offset = 0;
rs = ZOOM_connection_search(link, q);
ZOOM_query_destroy(q);
ZOOM_resultset_destroy(cl->resultset);
pazpar2_mutex_create(&cl->mutex, "client");
cl->preferred = 0;
cl->ref_count = 1;
+ cl->facet_limits = 0;
assert(id);
cl->id = xstrdup(id);
client_use(1);
c->cqlquery = 0;
xfree(c->id);
assert(!c->connection);
+ facet_limits_destroy(c->facet_limits);
if (c->resultset)
{
return r;
}
-static void apply_limit(struct session_database *sdb,
- facet_limits_t facet_limits,
- WRBUF w_pqf, WRBUF w_ccl)
+const char *client_get_facet_limit_local(struct client *cl,
+ struct session_database *sdb,
+ int *l,
+ NMEM nmem, int *num, char ***values)
{
+ const char *name = 0;
+ const char *value = 0;
+ for (; (name = facet_limits_get(cl->facet_limits, *l, &value)); (*l)++)
+ {
+ struct setting *s = 0;
+
+ for (s = sdb->settings[PZ_LIMITMAP]; s; s = s->next)
+ {
+ const char *p = strchr(s->name + 3, ':');
+ if (p && !strcmp(p + 1, name) && s->value &&
+ !strncmp(s->value, "local:", 6))
+ {
+ nmem_strsplit_escape2(nmem, "|", value, values,
+ num, 1, '\\', 1);
+ (*l)++;
+ return name;
+ }
+ }
+ }
+ return 0;
+}
+
+static int apply_limit(struct session_database *sdb,
+ facet_limits_t facet_limits,
+ WRBUF w_pqf, WRBUF w_ccl)
+{
+ int ret = 0;
int i = 0;
const char *name;
const char *value;
wrbuf_puts(w_ccl, ")");
}
+ else if (!strncmp(s->value, "local:", 6))
+ ;
+ else
+ {
+ yaz_log(YLOG_WARN, "Target %s: Bad limitmap '%s'",
+ sdb->database->id, s->value);
+ ret = -1; /* bad limitmap */
+ }
break;
}
}
}
}
nmem_destroy(nmem_tmp);
+ return ret;
}
// Parse the query given the settings specific to this client
int client_parse_query(struct client *cl, const char *query,
- facet_limits_t facet_limits)
+ facet_limits_t facet_limits,
+ const char *startrecs, const char *maxrecs)
{
struct session *se = client_get_session(cl);
struct session_database *sdb = client_get_database(cl);
const char *pqf_strftime = session_setting_oneval(sdb, PZ_PQF_STRFTIME);
const char *query_syntax = session_setting_oneval(sdb, PZ_QUERY_SYNTAX);
WRBUF w_ccl, w_pqf;
+ int ret_value = 1;
+
if (!ccl_map)
return -1;
- cl->hits = -1;
+
+ if (maxrecs && atoi(maxrecs) != cl->maxrecs)
+ {
+ ret_value = 0;
+ cl->maxrecs = atoi(maxrecs);
+ }
+
+ if (startrecs && atoi(startrecs) != cl->startrecs)
+ {
+ ret_value = 0;
+ cl->startrecs = atoi(startrecs);
+ }
+
w_ccl = wrbuf_alloc();
wrbuf_puts(w_ccl, query);
wrbuf_puts(w_pqf, " ");
}
- apply_limit(sdb, facet_limits, w_pqf, w_ccl);
+ if (apply_limit(sdb, facet_limits, w_pqf, w_ccl))
+ return -2;
+
+ facet_limits_destroy(cl->facet_limits);
+ cl->facet_limits = facet_limits_dup(facet_limits);
yaz_log(YLOG_LOG, "CCL query: %s", wrbuf_cstr(w_ccl));
cn = ccl_find_str(ccl_map, wrbuf_cstr(w_ccl), &cerror, &cpos);
wrbuf_putc(w_pqf, cp[0]);
}
}
- xfree(cl->pquery);
- cl->pquery = xstrdup(wrbuf_cstr(w_pqf));
+ if (!cl->pquery || strcmp(cl->pquery, wrbuf_cstr(w_pqf)))
+ {
+ xfree(cl->pquery);
+ cl->pquery = xstrdup(wrbuf_cstr(w_pqf));
+ ret_value = 0;
+ }
wrbuf_destroy(w_pqf);
yaz_log(YLOG_LOG, "PQF query: %s", cl->pquery);
}
ccl_rpn_delete(cn);
- return 0;
+ return ret_value;
}
void client_set_session(struct client *cl, struct session *se)
return cl->id;
}
-void client_set_maxrecs(struct client *cl, int v)
-{
- cl->maxrecs = v;
-}
-
int client_get_maxrecs(struct client *cl)
{
return cl->maxrecs;
}
-void client_set_startrecs(struct client *cl, int v)
-{
- cl->startrecs = v;
-}
-
void client_set_preferred(struct client *cl, int v)
{
cl->preferred = v;
int operation_timeout, int session_timeout,
iochan_man_t iochan,
const struct timeval *abstime);
-void client_start_search(struct client *cl, const char *sort_strategy_and_spec,
- int increasing);
+void client_start_search(struct client *cl);
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);
struct client *client_next_in_session(struct client *cl);
int client_parse_query(struct client *cl, const char *query,
- facet_limits_t facet_limits);
+ facet_limits_t facet_limits, const char *startrecs,
+ const char *maxrecs);
Odr_int client_get_hits(struct client *cl);
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);
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);
void client_remove_from_session(struct client *c);
void client_incref(struct client *c);
void client_got_records(struct client *c);
int client_has_facet(struct client *cl, const char *name);
void client_check_preferred_watch(struct client *cl);
-
+void client_reingest(struct client *cl);
+const char *client_get_facet_limit_local(struct client *cl,
+ struct session_database *sdb,
+ int *l,
+ NMEM nmem, int *num, char ***values);
#endif
/*
ZOOM_connection_destroy(co->link);
iochan_destroy(co->iochan);
}
- yaz_log(YLOG_DEBUG, "%p Connection destroy %s", co, co->host->hostport);
+ yaz_log(YLOG_DEBUG, "%p Connection destroy %s", co, co->host->url);
if (co->client)
{
co->operation_timeout = operation_timeout;
co->session_timeout = session_timeout;
- connection_connect(co, iochan_man);
+ if (host->ipport)
+ connection_connect(co, iochan_man);
yaz_mutex_enter(host->mutex);
co->next = co->host->connections;
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_Closed)
+ {
+ 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;
const char *sru_version = 0;
struct session_database *sdb = client_get_database(con->client);
- const char *zproxy = session_setting_oneval(sdb, PZ_ZPROXY);
const char *apdulog = session_setting_oneval(sdb, PZ_APDULOG);
assert(con);
if ((charset = session_setting_oneval(sdb, PZ_NEGOTIATION_CHARSET)))
ZOOM_options_set(zoptions, "charset", charset);
- if (zproxy && *zproxy)
+ assert(host->ipport);
+ if (host->proxy)
{
- con->zproxy = xstrdup(zproxy);
- ZOOM_options_set(zoptions, "proxy", zproxy);
+ yaz_log(YLOG_LOG, "proxy=%s", host->ipport);
+ ZOOM_options_set(zoptions, "proxy", host->ipport);
}
+ else
+ {
+ assert(host->tproxy);
+ yaz_log(YLOG_LOG, "tproxy=%s", host->ipport);
+ ZOOM_options_set(zoptions, "tproxy", host->ipport);
+ }
+
if (apdulog && *apdulog)
ZOOM_options_set(zoptions, "apdulog", apdulog);
{
char http_hostport[512];
strcpy(http_hostport, "http://");
- strcat(http_hostport, host->hostport);
+ strcat(http_hostport, host->url);
+ yaz_log(YLOG_LOG, "SRU connect to : %s", http_hostport);
ZOOM_connection_connect(con->link, http_hostport, 0);
}
else
{
- ZOOM_connection_connect(con->link, host->hostport, 0);
+ ZOOM_connection_connect(con->link, host->url, 0);
}
-
con->iochan = iochan_create(-1, connection_handler, 0, "connection_socket");
con->state = Conn_Connecting;
iochan_settimeout(con->iochan, con->operation_timeout);
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);
+ const char *sru = session_setting_oneval(sdb, PZ_SRU);
struct host *host = 0;
+ int default_port = *sru ? 80 : 210;
if (zproxy && zproxy[0] == '\0')
zproxy = 0;
url = sdb->database->id;
host = find_host(client_get_session(cl)->service->server->database_hosts,
- url);
+ url, zproxy, default_port, iochan_man);
yaz_log(YLOG_DEBUG, "client_prep_connection: target=%s url=%s",
client_get_id(cl), url);
+ if (!host)
+ return 0;
co = client_get_connection(cl);
void connect_resolver_host(struct host *host, iochan_man_t iochan);
ZOOM_connection connection_get_link(struct connection *co);
void connection_continue(struct connection *co);
+void connect_resolver_host(struct host *host, iochan_man_t iochan_man);
#endif
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)
-{
- 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->mutex = 0;
-
- pazpar2_mutex_create(&host->mutex, "host");
-
- yaz_cond_create(&host->cond_ready);
-
- return host;
-}
-
-struct host *find_host(database_hosts_t hosts, const char *hostport)
-{
- struct host *p;
- yaz_mutex_enter(hosts->mutex);
- for (p = hosts->hosts; p; p = p->next)
- if (!strcmp(p->hostport, hostport))
- break;
- if (!p)
- {
- p = create_host(hostport);
- if (p)
- {
- p->next = hosts->hosts;
- hosts->hosts = p;
- }
- }
- yaz_mutex_leave(hosts->mutex);
- return p;
-}
-
struct database *new_database(const char *id, NMEM nmem)
{
struct database *db;
return i;
}
-database_hosts_t database_hosts_create(void)
-{
- database_hosts_t p = xmalloc(sizeof(*p));
- p->hosts = 0;
- p->mutex = 0;
- pazpar2_mutex_create(&p->mutex, "database");
- return p;
-}
-
-void database_hosts_destroy(database_hosts_t *pp)
-{
- if (*pp)
- {
- struct host *p = (*pp)->hosts;
- while (p)
- {
- struct host *p_next = p->next;
- yaz_mutex_destroy(&p->mutex);
- yaz_cond_destroy(&p->cond_ready);
- xfree(p->hostport);
- xfree(p);
- p = p_next;
- }
- yaz_mutex_destroy(&(*pp)->mutex);
- xfree(*pp);
- }
-}
-
/*
* Local variables:
* c-basic-offset: 4
#ifndef DATABASE_H
#define DATABASE_H
-typedef struct database_hosts *database_hosts_t;
struct session_database;
struct session;
struct conf_service;
int match_zurl(const char *zurl, const char *pattern);
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
char **darray;
};
+facet_limits_t facet_limits_dup(facet_limits_t fl)
+{
+ int i;
+ NMEM nmem = nmem_create();
+ facet_limits_t fn = nmem_malloc(nmem, sizeof(*fn));
+ fn->nmem = nmem;
+ fn->num = fl->num;
+ fn->darray = 0;
+ if (fl->num)
+ {
+ fn->darray = nmem_malloc(nmem, fn->num * sizeof(*fn->darray));
+ for (i = 0; i < fn->num; i++)
+ {
+ const char *src = fl->darray[i];
+ size_t sz = strlen(src) + 2 + strlen(src + strlen(src) + 1);
+ fn->darray[i] = nmem_malloc(nmem, sz);
+ memcpy(fn->darray[i], src, sz);
+ }
+ }
+ return fn;
+}
+
facet_limits_t facet_limits_create(const char *param)
{
int i;
void facet_limits_destroy(facet_limits_t fl);
+facet_limits_t facet_limits_dup(facet_limits_t fl);
+
#endif
/*
--- /dev/null
+/* 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 <config.h>
+#endif
+
+#include "sel_thread.h"
+
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <stdlib.h>
+
+#include <assert.h>
+#include <sys/types.h>
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef WIN32
+#include <winsock.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#include <yaz/log.h>
+#include <yaz/nmem.h>
+#include <yaz/tcpip.h>
+
+#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->tproxy ? host->tproxy : host->proxy;
+ 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
+ */
+
--- /dev/null
+/* 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 <config.h>
+#endif
+
+#include <assert.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <yaz/log.h>
+#include <yaz/nmem.h>
+
+#include "ppmutex.h"
+#include "session.h"
+#include "host.h"
+
+#include <sys/types.h>
+
+struct database_hosts {
+ struct host *hosts;
+ YAZ_MUTEX mutex;
+};
+
+// Create a new host structure for hostport
+static struct host *create_host(const char *url, const char *proxy,
+ int default_port,
+ iochan_man_t iochan_man)
+{
+ struct host *host;
+ char *db_comment;
+
+ host = xmalloc(sizeof(struct host));
+ host->url = xstrdup(url);
+ host->proxy = 0;
+ host->tproxy = 0;
+ if (proxy && *proxy)
+ host->proxy = xstrdup(proxy);
+ else
+ {
+ char *cp;
+
+ host->tproxy = xmalloc (strlen(url) + 10); /* so we can add :port */
+ strcpy(host->tproxy, url);
+ for (cp = host->tproxy; *cp; cp++)
+ if (strchr("/?#~", *cp))
+ {
+ *cp = '\0';
+ break;
+ }
+ if (!strchr(host->tproxy, ':'))
+ sprintf(cp, ":%d", default_port); /* no port given, add it */
+ }
+
+ db_comment = strchr(host->url, '#');
+ if (db_comment)
+ *db_comment = '\0';
+ host->connections = 0;
+ host->ipport = 0;
+ host->mutex = 0;
+
+ if (host_getaddrinfo(host, iochan_man))
+ {
+ xfree(host->ipport);
+ xfree(host->tproxy);
+ xfree(host->proxy);
+ xfree(host->url);
+ xfree(host);
+ return 0;
+ }
+ pazpar2_mutex_create(&host->mutex, "host");
+
+ yaz_cond_create(&host->cond_ready);
+
+ return host;
+}
+
+struct host *find_host(database_hosts_t hosts, const char *url,
+ const char *proxy, int port,
+ iochan_man_t iochan_man)
+{
+ struct host *p;
+ yaz_mutex_enter(hosts->mutex);
+ for (p = hosts->hosts; p; p = p->next)
+ if (!strcmp(p->url, url))
+ break;
+ if (!p)
+ {
+ p = create_host(url, proxy, port, iochan_man);
+ if (p)
+ {
+ p->next = hosts->hosts;
+ hosts->hosts = p;
+ }
+ }
+ yaz_mutex_leave(hosts->mutex);
+ return p;
+}
+
+database_hosts_t database_hosts_create(void)
+{
+ database_hosts_t p = xmalloc(sizeof(*p));
+ p->hosts = 0;
+ p->mutex = 0;
+ pazpar2_mutex_create(&p->mutex, "database");
+ return p;
+}
+
+void database_hosts_destroy(database_hosts_t *pp)
+{
+ if (*pp)
+ {
+ struct host *p = (*pp)->hosts;
+ while (p)
+ {
+ struct host *p_next = p->next;
+ yaz_mutex_destroy(&p->mutex);
+ yaz_cond_destroy(&p->cond_ready);
+ xfree(p->url);
+ xfree(p->ipport);
+ xfree(p);
+ p = p_next;
+ }
+ yaz_mutex_destroy(&(*pp)->mutex);
+ xfree(*pp);
+ }
+}
+
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * c-file-style: "Stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+
#include <yaz/mutex.h>
+typedef struct database_hosts *database_hosts_t;
+
/** \brief Represents a host (irrespective of databases) */
struct host {
- char *hostport;
+ char *url; // logical host/database?args ..
+ char *tproxy; // tproxy address (no Z39.50 UI)
+ char *proxy; // logical proxy address
+ char *ipport; // tproxy or proxy resolved
struct connection *connections; // All connections to this
struct host *next;
YAZ_MUTEX mutex;
YAZ_COND cond_ready;
};
+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,
+ const char *proxy, int port, iochan_man_t iochan_man);
+
+int host_getaddrinfo(struct host *host, iochan_man_t iochan_man);
#endif
#endif
#ifdef WIN32
#include <winsock.h>
+#include <direct.h>
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
show_version();
break;
case 'w':
- if (chdir(arg))
+ if (
+#ifdef WIN32
+ _chdir
+#else
+ chdir
+#endif
+ (arg))
{
yaz_log(YLOG_FATAL|YLOG_ERRNO, "chdir %s", arg);
return 1;
#include "charsets.h"
#include "http.h"
#include "database.h"
+#include "host.h"
enum conf_metadata_type {
Metadata_type_generic, // Generic text field
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;
yaz_mutex_leave(s->session_mutex);
}
-void add_facet(struct session *s, const char *type, const char *value, int count)
+static void session_normalize_facet(struct session *s, const char *type,
+ const char *value,
+ WRBUF display_wrbuf,
+ WRBUF facet_wrbuf)
{
struct conf_service *service = s->service;
pp2_charset_token_t prt;
const char *facet_component;
- WRBUF facet_wrbuf = wrbuf_alloc();
- WRBUF display_wrbuf = wrbuf_alloc();
int i;
const char *icu_chain_id = 0;
}
}
pp2_charset_token_destroy(prt);
+}
+
+void add_facet(struct session *s, const char *type, const char *value, int count)
+{
+ WRBUF facet_wrbuf = wrbuf_alloc();
+ WRBUF display_wrbuf = wrbuf_alloc();
+
+ session_normalize_facet(s, type, value, display_wrbuf, facet_wrbuf);
if (wrbuf_len(facet_wrbuf))
{
{
const char *s;
- if (!sdb->settings)
- {
- session_log(se, YLOG_WARN, "No settings on %s", sdb->database->id);
- return -1;
- }
- if ((s = session_setting_oneval(sdb, PZ_XSLT)))
+ if (sdb->settings && sdb->settings[PZ_XSLT] && !sdb->map &&
+ (s = session_setting_oneval(sdb, PZ_XSLT)))
{
char auto_stylesheet[256];
return 0;
}
-// This analyzes settings and recomputes any supporting data structures
-// if necessary.
-static int prepare_session_database(struct session *se,
- struct session_database *sdb)
-{
- if (!sdb->settings)
- {
- session_log(se, YLOG_WARN,
- "No settings associated with %s", sdb->database->id);
- return -1;
- }
- if (sdb->settings[PZ_XSLT] && !sdb->map)
- {
- if (prepare_map(se, sdb) < 0)
- return -1;
- }
- return 0;
-}
-
// called if watch should be removed because http_channel is to be destroyed
static void session_watch_cancel(void *data, struct http_channel *c,
void *data2)
static void select_targets_callback(struct session *se,
struct session_database *db)
{
- struct client *cl = client_create(db->database->id);
+ struct client *cl;
struct client_list *l;
- client_set_database(cl, db);
+ for (l = se->clients_cached; l; l = l->next)
+ if (client_get_database(l->client) == db)
+ break;
- client_set_session(cl, se);
+ if (l)
+ cl = l->client;
+ else
+ {
+ cl = client_create(db->database->id);
+ client_set_database(cl, db);
+ client_set_session(cl, se);
+
+ l = xmalloc(sizeof(*l));
+ l->client = cl;
+ l->next = se->clients_cached;
+ se->clients_cached = l;
+ }
l = xmalloc(sizeof(*l));
l->client = cl;
- l->next = se->clients;
- se->clients = l;
+ l->next = se->clients_active;
+ se->clients_active = l;
}
-static void session_remove_clients(struct session *se)
+static void session_reset_active_clients(struct session *se,
+ struct client_list *new_list)
{
struct client_list *l;
session_enter(se);
- l = se->clients;
- se->clients = 0;
+ l = se->clients_active;
+ se->clients_active = new_list;
+ session_leave(se);
+
+ while (l)
+ {
+ struct client_list *l_next = l->next;
+ xfree(l);
+ l = l_next;
+ }
+}
+
+static void session_remove_cached_clients(struct session *se)
+{
+ struct client_list *l;
+
+ session_reset_active_clients(se, 0);
+
+ session_enter(se);
+ l = se->clients_cached;
+ se->clients_cached = 0;
session_leave(se);
while (l)
struct client_list *l;
int res = 0;
- for (l = s->clients; l; l = l->next)
+ for (l = s->clients_active; l; l = l->next)
if (client_is_active(l->client))
res++;
struct client_list *l;
int res = 0;
- for (l = s->clients; l; l = l->next)
+ for (l = s->clients_active; l; l = l->next)
if (client_is_active_preferred(l->client))
res++;
session_log(s, YLOG_DEBUG, "Has %d active preferred clients.", res);
return res == 0;
}
-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;
sr->next = se->sorted_results;
se->sorted_results = sr;
- for (l = se->clients; l; l = l->next)
+ for (l = se->clients_active; 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);
- }
+ 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);
}
session_leave(se);
}
{
int live_channels = 0;
int no_working = 0;
- int no_failed = 0;
- struct client_list *l;
+ int no_failed_query = 0;
+ int no_failed_limit = 0;
+ struct client_list *l, *l0;
struct timeval tval;
facet_limits_t facet_limits;
*addinfo = 0;
- session_remove_clients(se);
+ if (se->settings_modified)
+ session_remove_cached_clients(se);
+ else
+ session_reset_active_clients(se, 0);
session_enter(se);
reclist_destroy(se->reclist);
se->reclist = 0;
+ se->settings_modified = 0;
relevance_destroy(&se->relevance);
nmem_reset(se->nmem);
se->total_records = se->total_merged = 0;
session_leave(se);
return PAZPAR2_MALFORMED_PARAMETER_VALUE;
}
- for (l = se->clients; l; l = l->next)
+
+ l0 = se->clients_active;
+ se->clients_active = 0;
+ session_leave(se);
+
+ for (l = l0; l; l = l->next)
{
+ int parse_ret;
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));
- if (startrecs)
- client_set_startrecs(cl, atoi(startrecs));
- if (prepare_session_database(se, client_get_database(cl)) < 0)
- ;
- else if (client_parse_query(cl, query, facet_limits) < 0)
- no_failed++;
+
+ if (prepare_map(se, client_get_database(cl)) < 0)
+ continue;
+
+ parse_ret = client_parse_query(cl, query, facet_limits, startrecs,
+ maxrecs);
+ if (parse_ret == -1)
+ no_failed_query++;
+ else if (parse_ret == -2)
+ no_failed_limit++;
+ else if (parse_ret == 0)
+ {
+ session_log(se, YLOG_LOG, "client NEW %s", client_get_id(cl));
+ no_working++;
+ 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);
+ }
else
{
+ session_log(se, YLOG_LOG, "client REUSE %s", client_get_id(cl));
no_working++;
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);
+ {
+ client_reingest(cl);
+ }
}
}
facet_limits_destroy(facet_limits);
- session_leave(se);
+ session_reset_active_clients(se, l0);
+
if (no_working == 0)
{
- if (no_failed > 0)
+ if (no_failed_query > 0)
{
*addinfo = "query";
return PAZPAR2_MALFORMED_PARAMETER_VALUE;
}
+ else if (no_failed_limit > 0)
+ {
+ *addinfo = "limit";
+ return PAZPAR2_MALFORMED_PARAMETER_VALUE;
+ }
else
return PAZPAR2_NO_TARGETS;
}
+ yaz_log(YLOG_LOG, "session_start_search done");
return PAZPAR2_NO_ERROR;
}
new->next = sdb->settings[offset];
sdb->settings[offset] = new;
+ se->settings_modified = 1;
+
// Force later recompute of settings-driven data structures
// (happens when a search starts and client connections are prepared)
switch (offset)
}
}
-void session_destroy(struct session *se) {
+void session_destroy(struct session *se)
+{
struct session_database *sdb;
session_log(se, YLOG_DEBUG, "Destroying");
session_use(-1);
- session_remove_clients(se);
+ session_remove_cached_clients(se);
for (sdb = se->databases; sdb; sdb = sdb->next)
session_database_destroy(sdb);
session->number_of_warnings_unknown_metadata = 0;
session->num_termlists = 0;
session->reclist = 0;
- session->clients = 0;
+ session->clients_active = 0;
+ session->clients_cached = 0;
+ session->settings_modified = 0;
session->session_nmem = nmem;
session->nmem = nmem_create();
session->databases = 0;
struct client_list *l;
size_t sz = 0;
- for (l = se->clients; l; l = l->next)
+ for (l = se->clients_active; l; l = l->next)
sz++;
res = nmem_malloc(nmem, sizeof(*res) * sz);
*count = 0;
- for (l = se->clients; l; l = l->next)
+ for (l = se->clients_active; l; l = l->next)
{
struct client *cl = l->client;
WRBUF w = wrbuf_alloc();
*total = reclist_get_num_records(se->reclist);
*sumhits = 0;
- for (l = se->clients; l; l = l->next)
+ for (l = se->clients_active; l; l = l->next)
*sumhits += client_get_hits(l->client);
for (i = 0; i < start; i++)
memset(stat, 0, sizeof(*stat));
stat->num_hits = 0;
- for (l = se->clients; l; l = l->next)
+ for (l = se->clients_active; l; l = l->next)
{
struct client *cl = l->client;
if (!client_get_connection(cl))
}
session_enter(se);
if (client_get_session(cl) == se)
- ingest_to_cluster(cl, xdoc, root, record_no, mergekey_norm);
+ ret = ingest_to_cluster(cl, xdoc, root, record_no, mergekey_norm);
session_leave(se);
xmlFreeDoc(xdoc);
return ret;
}
+static int check_limit_local(struct client *cl,
+ struct record *record,
+ int record_no)
+{
+ int skip_record = 0;
+ struct session *se = client_get_session(cl);
+ struct conf_service *service = se->service;
+ NMEM nmem_tmp = nmem_create();
+ struct session_database *sdb = client_get_database(cl);
+ int l = 0;
+ while (!skip_record)
+ {
+ struct conf_metadata *ser_md = 0;
+ struct record_metadata *rec_md = 0;
+ int md_field_id;
+ char **values = 0;
+ int i, num_v = 0;
+
+ const char *name =
+ client_get_facet_limit_local(cl, sdb, &l, nmem_tmp, &num_v,
+ &values);
+ if (!name)
+ break;
+
+ md_field_id = conf_service_metadata_field_id(service, name);
+ if (md_field_id < 0)
+ {
+ skip_record = 1;
+ break;
+ }
+ ser_md = &service->metadata[md_field_id];
+ rec_md = record->metadata[md_field_id];
+ yaz_log(YLOG_LOG, "check limit local %s", name);
+ for (i = 0; i < num_v; )
+ {
+ if (rec_md)
+ {
+ if (ser_md->type == Metadata_type_year
+ || ser_md->type == Metadata_type_date)
+ {
+ int y = atoi(values[i]);
+ if (y >= rec_md->data.number.min
+ && y <= rec_md->data.number.max)
+ break;
+ }
+ else
+ {
+ yaz_log(YLOG_LOG, "cmp: '%s' '%s'",
+ rec_md->data.text.disp, values[i]);
+ if (!strcmp(rec_md->data.text.disp, values[i]))
+ {
+ break;
+ }
+ }
+ rec_md = rec_md->next;
+ }
+ else
+ {
+ rec_md = record->metadata[md_field_id];
+ i++;
+ }
+ }
+ if (i == num_v)
+ {
+ skip_record = 1;
+ break;
+ }
+ }
+ nmem_destroy(nmem_tmp);
+ return skip_record;
+}
+
static int ingest_to_cluster(struct client *cl,
xmlDoc *xdoc,
xmlNode *root,
}
}
+ if (check_limit_local(cl, record, record_no))
+ {
+ session_log(se, YLOG_LOG, "Facet filtered out record no %d from %s",
+ record_no, sdb->database->id);
+ if (type)
+ xmlFree(type);
+ if (value)
+ xmlFree(value);
+ return -2;
+ }
cluster = reclist_insert(se->reclist, service, record,
mergekey_norm, &se->total_merged);
if (!cluster)
struct session {
struct conf_service *service; /* service in use for this session */
struct session_database *databases; // All databases, settings overriden
- struct client_list *clients; // Clients connected for current search
+ struct client_list *clients_active; // Clients connected for current search
+ struct client_list *clients_cached; // Clients in cache
NMEM session_nmem; // Nmem for session-permanent storage
NMEM nmem; // Nmem for each operation (i.e. search, result set, etc)
int num_termlists;
normalize_cache_t normalize_cache;
YAZ_MUTEX session_mutex;
unsigned session_id;
+ int settings_modified;
struct session_sorted_results *sorted_results;
};
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, ...)
;
#endif
+struct session_sorted_results {
+ const char *field;
+ int increasing;
+ struct session_sorted_results *next;
+};
+
/*
* Local variables:
* c-basic-offset: 4
</pz:metadata>
</xsl:for-each>
- <xsl:for-each select="marc:datafield[@tag='650' or @tag='653']">
+ <xsl:for-each select="marc:datafield[@tag='600' or @tag='610' or @tag='611' or @tag='630' or @tag='648' or @tag='650' or @tag='651' or @tag='653' or @tag='654' or @tag='655' or @tag='656' or @tag='657' or @tag='658' or @tag='662' or @tag='69X']">
<pz:metadata type="subject">
<xsl:value-of select="marc:subfield[@code='a']"/>
</pz:metadata>
<metadata name="date" brief="yes" sortkey="numeric" type="year" merge="range"
termlist="yes"/>
<metadata name="author" brief="yes" termlist="yes" merge="longest" rank="2" mergekey="optional" />
- <metadata name="subject" merge="unique" termlist="yes" rank="3"/>
+ <metadata name="subject" brief="yes" merge="unique" termlist="yes" rank="3"/>
<metadata name="id"/>
<metadata name="lccn" merge="unique"/>
<metadata name="description" brief="yes" merge="longest" rank="3"/>
2 http://localhost:9763/search.pz2?session=8&command=show&block=1
http://localhost:9763/search.pz2?session=8&command=search&query=a+and
1 http://localhost:9763/search.pz2?session=8&command=show&block=1
-http://localhost:9763/search.pz2?command=init&pz:limitmap:author%5Bz3950.indexdata.com%2Fmarc%5D=ccl:author_phrase
-1 http://localhost:9763/search.pz2?session=9&command=search&query=greece&limit=author%3dadam\,+james%7Cother_author
+http://localhost:9763/search.pz2?command=init&pz:limitmap:author%5Bz3950.indexdata.com%2Fmarc%5D=ccl:author_phrase&pz:limitmap:subject%5Bz3950.indexdata.com%2fmarc%5D=local:&pz:limitmap:date%5Bz3950.indexdata.com%2fmarc%5D=local:
+1 http://localhost:9763/search.pz2?session=9&command=search&query=greece&limit=author%3Dadam\,+james%7Cother_author
1 http://localhost:9763/search.pz2?session=9&command=show&block=1
-http://localhost:9763/search.pz2?session=9&command=settings&pz:limitmap:author%5Bz3950.indexdata.com%2Fmarc%5D=rpn:%40attr+1%3d1003+%40attr+6%3d3
-1 http://localhost:9763/search.pz2?session=9&command=search&query=greece&limit=author%3dadam\,+james%7Cother_author
+http://localhost:9763/search.pz2?session=9&command=settings&pz:limitmap:author%5Bz3950.indexdata.com%2Fmarc%5D=rpn:%40attr+1%3D1003+%40attr+6%3D3
+1 http://localhost:9763/search.pz2?session=9&command=search&query=greece&limit=author%3Dadam\,+james%7Cother_author
1 http://localhost:9763/search.pz2?session=9&command=show&block=1
+http://localhost:9763/search.pz2?session=9&command=search&query=greece&limit=author%3Dadam\,+james%7Cother_author&filter=pz%3Aid%3Dz3950.indexdata.com%2Fmarc
+http://localhost:9763/search.pz2?session=9&command=bytarget
+http://localhost:9763/search.pz2?session=9&command=show
+http://localhost:9763/search.pz2?session=9&command=search&query=greece&limit=author%3Dadam\,+james%7Cother_author&filter=pz%3Aid%3Dnone
+http://localhost:9763/search.pz2?session=9&command=bytarget
+http://localhost:9763/search.pz2?session=9&command=show
+http://localhost:9763/search.pz2?session=9&command=search&query=greece&limit=author%3Dadam\,+james%7Cother_author
+http://localhost:9763/search.pz2?session=9&command=bytarget
+http://localhost:9763/search.pz2?session=9&command=show
+http://localhost:9763/search.pz2?session=9&command=search&query=computer&limit=subject%3DRailroads
+http://localhost:9763/search.pz2?session=9&command=show&block=1
+http://localhost:9763/search.pz2?session=9&command=search&query=computer&limit=date%3D1977
+http://localhost:9763/search.pz2?session=9&command=show&block=1
<md-title>The Computer Bible</md-title>
<md-date>1973-1980</md-date>
+<md-subject>Bible. O.T</md-subject>
+<md-subject>Bible</md-subject>
<md-description>Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>The Computer Bible</md-title>
<md-date>1973-1980</md-date>
+<md-subject>Bible. O.T</md-subject>
+<md-subject>Bible</md-subject>
<md-description tag="500">Hebrew and Greek; introductions in English</md-description>
<md-description tag="500">Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-title>Computer science & technology</md-title>
<md-title-remainder>proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976</md-title-remainder>
-<md-date>1977</md-date><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
+<md-date>1977</md-date>
+<md-subject>Optical pattern recognition</md-subject><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>Computer science & technology</md-title>
<md-title-remainder>proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976</md-title-remainder>
<md-date>1977</md-date>
+<md-subject>Optical pattern recognition</md-subject>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
YYYYYYYYY</md-test-usersetting-2></location>
<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
<md-title-remainder>proceedings of the workshop</md-title-remainder>
<md-date>1977</md-date>
+<md-subject>Tomography</md-subject>
<md-description>Includes bibliographical references and index</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
<md-title-remainder>proceedings of the workshop</md-title-remainder>
<md-date>1977</md-date>
+<md-subject>Tomography</md-subject>
<md-description tag="504">Includes bibliographical references and index</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
<md-title>The use of passwords for controlled access to computer resources</md-title>
<md-date>1977</md-date>
-<md-author>Wood, Helen M</md-author><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
+<md-author>Wood, Helen M</md-author>
+<md-subject>Computers</md-subject><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>The use of passwords for controlled access to computer resources</md-title>
<md-date>1977</md-date>
<md-author>Wood, Helen M</md-author>
+<md-subject>Computers</md-subject>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
YYYYYYYYY</md-test-usersetting-2></location>
<md-title>Computer processing of dynamic images from an Anger scintillation camera</md-title>
<md-title-remainder>the proceedings of a workshop</md-title-remainder>
<md-date>1974</md-date>
+<md-subject>Radioisotope scanning</md-subject>
+<md-subject>Scintillation cameras</md-subject>
+<md-subject>Imaging systems in medicine</md-subject>
<md-description>Includes bibliographical references and index</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>Computer processing of dynamic images from an Anger scintillation camera</md-title>
<md-title-remainder>the proceedings of a workshop</md-title-remainder>
<md-date>1974</md-date>
+<md-subject>Radioisotope scanning</md-subject>
+<md-subject>Scintillation cameras</md-subject>
+<md-subject>Imaging systems in medicine</md-subject>
<md-description tag="504">Includes bibliographical references and index</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
<md-title-remainder>a portfolio of thematic computer maps</md-title-remainder>
<md-date>1974</md-date>
<md-author>Mairs, John W</md-author>
+<md-subject>Cartography</md-subject>
+<md-subject>Puget Sound region (Wash.)</md-subject>
<md-description>Scale of maps ca. 1:1,000,000</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>The Puget Sound Region</md-title>
<md-title-remainder>a portfolio of thematic computer maps</md-title-remainder>
<md-date>1974</md-date>
<md-author>Mairs, John W</md-author>
+<md-subject>Cartography</md-subject>
+<md-subject>Puget Sound region (Wash.)</md-subject>
<md-description tag="500">Scale of maps ca. 1:1,000,000</md-description>
<md-description tag="504">Bibliography: p. 4</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-title>A plan for community college computer development</md-title>
<md-date>1971</md-date>
+<md-subject>Universities and colleges</md-subject>
+<md-subject>Community colleges</md-subject>
<md-description>Cover title</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>A plan for community college computer development</md-title>
<md-date>1971</md-date>
+<md-subject>Universities and colleges</md-subject>
+<md-subject>Community colleges</md-subject>
<md-description tag="500">Cover title</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
<md-title-remainder>final report</md-title-remainder>
<md-date>1971</md-date>
<md-author>Englund, Carl R</md-author>
+<md-subject>Railroads</md-subject>
<md-description>"Contract DOT-UT-10003."</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>Washington metropolitan area rail computer feasibility study;</md-title>
<md-title-remainder>final report</md-title-remainder>
<md-date>1971</md-date>
<md-author>Englund, Carl R</md-author>
+<md-subject>Railroads</md-subject>
<md-description tag="500">"Contract DOT-UT-10003."</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
<md-title>A plan for community college computer development</md-title>
<md-date>1971</md-date>
+<md-subject>Universities and colleges</md-subject>
+<md-subject>Community colleges</md-subject>
<md-description>Cover title</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>A plan for community college computer development</md-title>
<md-date>1971</md-date>
+<md-subject>Universities and colleges</md-subject>
+<md-subject>Community colleges</md-subject>
<md-description tag="500">Cover title</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
<md-title-remainder>final report</md-title-remainder>
<md-date>1971</md-date>
<md-author>Englund, Carl R</md-author>
+<md-subject>Railroads</md-subject>
<md-description>"Contract DOT-UT-10003."</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>Washington metropolitan area rail computer feasibility study;</md-title>
<md-title-remainder>final report</md-title-remainder>
<md-date>1971</md-date>
<md-author>Englund, Carl R</md-author>
+<md-subject>Railroads</md-subject>
<md-description tag="500">"Contract DOT-UT-10003."</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
<md-title>The Computer Bible</md-title>
<md-date>1973-1980</md-date>
+<md-subject>Bible. O.T</md-subject>
+<md-subject>Bible</md-subject>
<md-description>Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>The Computer Bible</md-title>
<md-date>1973-1980</md-date>
+<md-subject>Bible. O.T</md-subject>
+<md-subject>Bible</md-subject>
<md-description tag="500">Hebrew and Greek; introductions in English</md-description>
<md-description tag="500">Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-title>Computer processing of dynamic images from an Anger scintillation camera</md-title>
<md-title-remainder>the proceedings of a workshop</md-title-remainder>
<md-date>1974</md-date>
+<md-subject>Radioisotope scanning</md-subject>
+<md-subject>Scintillation cameras</md-subject>
+<md-subject>Imaging systems in medicine</md-subject>
<md-description>Includes bibliographical references and index</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>Computer processing of dynamic images from an Anger scintillation camera</md-title>
<md-title-remainder>the proceedings of a workshop</md-title-remainder>
<md-date>1974</md-date>
+<md-subject>Radioisotope scanning</md-subject>
+<md-subject>Scintillation cameras</md-subject>
+<md-subject>Imaging systems in medicine</md-subject>
<md-description tag="504">Includes bibliographical references and index</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
<md-title-remainder>a portfolio of thematic computer maps</md-title-remainder>
<md-date>1974</md-date>
<md-author>Mairs, John W</md-author>
+<md-subject>Cartography</md-subject>
+<md-subject>Puget Sound region (Wash.)</md-subject>
<md-description>Scale of maps ca. 1:1,000,000</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>The Puget Sound Region</md-title>
<md-title-remainder>a portfolio of thematic computer maps</md-title-remainder>
<md-date>1974</md-date>
<md-author>Mairs, John W</md-author>
+<md-subject>Cartography</md-subject>
+<md-subject>Puget Sound region (Wash.)</md-subject>
<md-description tag="500">Scale of maps ca. 1:1,000,000</md-description>
<md-description tag="504">Bibliography: p. 4</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-title>Computer science & technology</md-title>
<md-title-remainder>proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976</md-title-remainder>
-<md-date>1977</md-date><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
+<md-date>1977</md-date>
+<md-subject>Optical pattern recognition</md-subject><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>Computer science & technology</md-title>
<md-title-remainder>proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976</md-title-remainder>
<md-date>1977</md-date>
+<md-subject>Optical pattern recognition</md-subject>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
YYYYYYYYY</md-test-usersetting-2></location>
<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
<md-title-remainder>proceedings of the workshop</md-title-remainder>
<md-date>1977</md-date>
+<md-subject>Tomography</md-subject>
<md-description>Includes bibliographical references and index</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
<md-title-remainder>proceedings of the workshop</md-title-remainder>
<md-date>1977</md-date>
+<md-subject>Tomography</md-subject>
<md-description tag="504">Includes bibliographical references and index</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
<md-title>The use of passwords for controlled access to computer resources</md-title>
<md-date>1977</md-date>
-<md-author>Wood, Helen M</md-author><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
+<md-author>Wood, Helen M</md-author>
+<md-subject>Computers</md-subject><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>The use of passwords for controlled access to computer resources</md-title>
<md-date>1977</md-date>
<md-author>Wood, Helen M</md-author>
+<md-subject>Computers</md-subject>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
YYYYYYYYY</md-test-usersetting-2></location>
<md-title>Computer science & technology</md-title>
<md-title-remainder>proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976</md-title-remainder>
-<md-date>1977</md-date><location id="z3950.indexdata.com/marc" name="marc">
+<md-date>1977</md-date>
+<md-subject>Optical pattern recognition</md-subject><location id="z3950.indexdata.com/marc" name="marc">
<md-title>Computer science & technology</md-title>
<md-title-remainder>proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976</md-title-remainder>
<md-date>1977</md-date>
+<md-subject>Optical pattern recognition</md-subject>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
YYYYYYYYY</md-test-usersetting-2></location>
<md-title>The Computer Bible</md-title>
<md-date>1973-1980</md-date>
+<md-subject>Bible. O.T</md-subject>
+<md-subject>Bible</md-subject>
<md-description>Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description><location id="z3950.indexdata.com/marc" name="marc">
<md-title>The Computer Bible</md-title>
<md-date>1973-1980</md-date>
+<md-subject>Bible. O.T</md-subject>
+<md-subject>Bible</md-subject>
<md-description tag="500">Hebrew and Greek; introductions in English</md-description>
<md-description tag="500">Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-title>A plan for community college computer development</md-title>
<md-date>1971</md-date>
+<md-subject>Universities and colleges</md-subject>
+<md-subject>Community colleges</md-subject>
<md-description>Cover title</md-description><location id="z3950.indexdata.com/marc" name="marc">
<md-title>A plan for community college computer development</md-title>
<md-date>1971</md-date>
+<md-subject>Universities and colleges</md-subject>
+<md-subject>Community colleges</md-subject>
<md-description tag="500">Cover title</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
<md-title-remainder>final report</md-title-remainder>
<md-date>1971</md-date>
<md-author>Englund, Carl R</md-author>
+<md-subject>Railroads</md-subject>
<md-description>"Contract DOT-UT-10003."</md-description><location id="z3950.indexdata.com/marc" name="marc">
<md-title>Washington metropolitan area rail computer feasibility study;</md-title>
<md-title-remainder>final report</md-title-remainder>
<md-date>1971</md-date>
<md-author>Englund, Carl R</md-author>
+<md-subject>Railroads</md-subject>
<md-description tag="500">"Contract DOT-UT-10003."</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
<md-title-remainder>a portfolio of thematic computer maps</md-title-remainder>
<md-date>1974</md-date>
<md-author>Mairs, John W</md-author>
+<md-subject>Cartography</md-subject>
+<md-subject>Puget Sound region (Wash.)</md-subject>
<md-description>Scale of maps ca. 1:1,000,000</md-description><location id="z3950.indexdata.com/marc" name="marc">
<md-title>The Puget Sound Region</md-title>
<md-title-remainder>a portfolio of thematic computer maps</md-title-remainder>
<md-date>1974</md-date>
<md-author>Mairs, John W</md-author>
+<md-subject>Cartography</md-subject>
+<md-subject>Puget Sound region (Wash.)</md-subject>
<md-description tag="500">Scale of maps ca. 1:1,000,000</md-description>
<md-description tag="504">Bibliography: p. 4</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-title>Computer processing of dynamic images from an Anger scintillation camera</md-title>
<md-title-remainder>the proceedings of a workshop</md-title-remainder>
<md-date>1974</md-date>
+<md-subject>Radioisotope scanning</md-subject>
+<md-subject>Scintillation cameras</md-subject>
+<md-subject>Imaging systems in medicine</md-subject>
<md-description>Includes bibliographical references and index</md-description><location id="z3950.indexdata.com/marc" name="marc">
<md-title>Computer processing of dynamic images from an Anger scintillation camera</md-title>
<md-title-remainder>the proceedings of a workshop</md-title-remainder>
<md-date>1974</md-date>
+<md-subject>Radioisotope scanning</md-subject>
+<md-subject>Scintillation cameras</md-subject>
+<md-subject>Imaging systems in medicine</md-subject>
<md-description tag="504">Includes bibliographical references and index</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
<md-title>The use of passwords for controlled access to computer resources</md-title>
<md-date>1977</md-date>
-<md-author>Wood, Helen M</md-author><location id="z3950.indexdata.com/marc" name="marc">
+<md-author>Wood, Helen M</md-author>
+<md-subject>Computers</md-subject><location id="z3950.indexdata.com/marc" name="marc">
<md-title>The use of passwords for controlled access to computer resources</md-title>
<md-date>1977</md-date>
<md-author>Wood, Helen M</md-author>
+<md-subject>Computers</md-subject>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
YYYYYYYYY</md-test-usersetting-2></location>
<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
<md-title-remainder>proceedings of the workshop</md-title-remainder>
<md-date>1977</md-date>
+<md-subject>Tomography</md-subject>
<md-description>Includes bibliographical references and index</md-description><location id="z3950.indexdata.com/marc" name="marc">
<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
<md-title-remainder>proceedings of the workshop</md-title-remainder>
<md-date>1977</md-date>
+<md-subject>Tomography</md-subject>
<md-description tag="504">Includes bibliographical references and index</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
<md-title>The religious teachers of Greece</md-title>
<md-date>1972</md-date>
<md-author>Adam, James</md-author>
+<md-subject>Greek literature</md-subject>
+<md-subject>Philosophy, Ancient</md-subject>
+<md-subject>Greece</md-subject>
<md-description>Reprint of the 1909 ed., which was issued as the 1904-1906 Gifford lectures</md-description><location id="z3950.indexdata.com/marc" name="marc">
<md-title>The religious teachers of Greece</md-title>
<md-date>1972</md-date>
<md-author>Adam, James</md-author>
+<md-subject>Greek literature</md-subject>
+<md-subject>Philosophy, Ancient</md-subject>
+<md-subject>Greece</md-subject>
<md-description tag="500">Reprint of the 1909 ed., which was issued as the 1904-1906 Gifford lectures</md-description>
<md-description tag="504">Includes bibliographical references</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-title-remainder>a portfolio of thematic computer maps</md-title-remainder>
<md-date>1974</md-date>
<md-author>Mairs, John W</md-author>
+<md-subject>Cartography</md-subject>
+<md-subject>Puget Sound region (Wash.)</md-subject>
<md-description>Scale of maps ca. 1:1,000,000</md-description><location id="z3950.indexdata.com/marc" name="marc">
<md-title>The Puget Sound Region</md-title>
<md-title-remainder>a portfolio of thematic computer maps</md-title-remainder>
<md-date>1974</md-date>
<md-author>Mairs, John W</md-author>
+<md-subject>Cartography</md-subject>
+<md-subject>Puget Sound region (Wash.)</md-subject>
<md-description tag="500">Scale of maps ca. 1:1,000,000</md-description>
<md-description tag="504">Bibliography: p. 4</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
<md-title-remainder>proceedings of the workshop</md-title-remainder>
<md-date>1977</md-date>
+<md-subject>Tomography</md-subject>
<md-description>Includes bibliographical references and index</md-description><location id="z3950.indexdata.com/marc" name="marc">
<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
<md-title-remainder>proceedings of the workshop</md-title-remainder>
<md-date>1977</md-date>
+<md-subject>Tomography</md-subject>
<md-description tag="504">Includes bibliographical references and index</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
<md-title>The use of passwords for controlled access to computer resources</md-title>
<md-date>1977</md-date>
-<md-author>Wood, Helen M</md-author><location id="z3950.indexdata.com/marc" name="marc">
+<md-author>Wood, Helen M</md-author>
+<md-subject>Computers</md-subject><location id="z3950.indexdata.com/marc" name="marc">
<md-title>The use of passwords for controlled access to computer resources</md-title>
<md-date>1977</md-date>
<md-author>Wood, Helen M</md-author>
+<md-subject>Computers</md-subject>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
YYYYYYYYY</md-test-usersetting-2></location>
<md-title>Computer science & technology</md-title>
<md-title-remainder>proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976</md-title-remainder>
-<md-date>1977</md-date><location id="z3950.indexdata.com/marc" name="marc">
+<md-date>1977</md-date>
+<md-subject>Optical pattern recognition</md-subject><location id="z3950.indexdata.com/marc" name="marc">
<md-title>Computer science & technology</md-title>
<md-title-remainder>proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976</md-title-remainder>
<md-date>1977</md-date>
+<md-subject>Optical pattern recognition</md-subject>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
YYYYYYYYY</md-test-usersetting-2></location>
<md-title>Computer processing of dynamic images from an Anger scintillation camera</md-title>
<md-title-remainder>the proceedings of a workshop</md-title-remainder>
<md-date>1974</md-date>
+<md-subject>Radioisotope scanning</md-subject>
+<md-subject>Scintillation cameras</md-subject>
+<md-subject>Imaging systems in medicine</md-subject>
<md-description>Includes bibliographical references and index</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>Computer processing of dynamic images from an Anger scintillation camera</md-title>
<md-title-remainder>the proceedings of a workshop</md-title-remainder>
<md-date>1974</md-date>
+<md-subject>Radioisotope scanning</md-subject>
+<md-subject>Scintillation cameras</md-subject>
+<md-subject>Imaging systems in medicine</md-subject>
<md-description tag="504">Includes bibliographical references and index</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
<md-title>The religious teachers of Greece</md-title>
<md-date>1972</md-date>
<md-author>Adam, James</md-author>
+<md-subject>Greek literature</md-subject>
+<md-subject>Philosophy, Ancient</md-subject>
+<md-subject>Greece</md-subject>
<md-description>Reprint of the 1909 ed., which was issued as the 1904-1906 Gifford lectures</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>The religious teachers of Greece</md-title>
<md-date>1972</md-date>
<md-author>Adam, James</md-author>
+<md-subject>Greek literature</md-subject>
+<md-subject>Philosophy, Ancient</md-subject>
+<md-subject>Greece</md-subject>
<md-description tag="500">Reprint of the 1909 ed., which was issued as the 1904-1906 Gifford lectures</md-description>
<md-description tag="504">Includes bibliographical references</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
YYYYYYYYY</md-test-usersetting-2></location>
-<relevance>120000</relevance>
+<relevance>420000</relevance>
<recid>content: title the religious teachers of greece author adam james medium book</recid>
</hit>
</show>
\ No newline at end of file
<md-title>Computer science & technology</md-title>
<md-title-remainder>proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976</md-title-remainder>
-<md-date>1977</md-date><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
+<md-date>1977</md-date>
+<md-subject>Optical pattern recognition</md-subject><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>Computer science & technology</md-title>
<md-title-remainder>proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976</md-title-remainder>
<md-date>1977</md-date>
+<md-subject>Optical pattern recognition</md-subject>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
YYYYYYYYY</md-test-usersetting-2></location>
<md-title>The Computer Bible</md-title>
<md-date>1973-1980</md-date>
+<md-subject>Bible. O.T</md-subject>
+<md-subject>Bible</md-subject>
<md-description>Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>The Computer Bible</md-title>
<md-date>1973-1980</md-date>
+<md-subject>Bible. O.T</md-subject>
+<md-subject>Bible</md-subject>
<md-description tag="500">Hebrew and Greek; introductions in English</md-description>
<md-description tag="500">Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-title>A plan for community college computer development</md-title>
<md-date>1971</md-date>
+<md-subject>Universities and colleges</md-subject>
+<md-subject>Community colleges</md-subject>
<md-description>Cover title</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>A plan for community college computer development</md-title>
<md-date>1971</md-date>
+<md-subject>Universities and colleges</md-subject>
+<md-subject>Community colleges</md-subject>
<md-description tag="500">Cover title</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
<md-title-remainder>final report</md-title-remainder>
<md-date>1971</md-date>
<md-author>Englund, Carl R</md-author>
+<md-subject>Railroads</md-subject>
<md-description>"Contract DOT-UT-10003."</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>Washington metropolitan area rail computer feasibility study;</md-title>
<md-title-remainder>final report</md-title-remainder>
<md-date>1971</md-date>
<md-author>Englund, Carl R</md-author>
+<md-subject>Railroads</md-subject>
<md-description tag="500">"Contract DOT-UT-10003."</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
<md-title-remainder>a portfolio of thematic computer maps</md-title-remainder>
<md-date>1974</md-date>
<md-author>Mairs, John W</md-author>
+<md-subject>Cartography</md-subject>
+<md-subject>Puget Sound region (Wash.)</md-subject>
<md-description>Scale of maps ca. 1:1,000,000</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>The Puget Sound Region</md-title>
<md-title-remainder>a portfolio of thematic computer maps</md-title-remainder>
<md-date>1974</md-date>
<md-author>Mairs, John W</md-author>
+<md-subject>Cartography</md-subject>
+<md-subject>Puget Sound region (Wash.)</md-subject>
<md-description tag="500">Scale of maps ca. 1:1,000,000</md-description>
<md-description tag="504">Bibliography: p. 4</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-title>Computer processing of dynamic images from an Anger scintillation camera</md-title>
<md-title-remainder>the proceedings of a workshop</md-title-remainder>
<md-date>1974</md-date>
+<md-subject>Radioisotope scanning</md-subject>
+<md-subject>Scintillation cameras</md-subject>
+<md-subject>Imaging systems in medicine</md-subject>
<md-description>Includes bibliographical references and index</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>Computer processing of dynamic images from an Anger scintillation camera</md-title>
<md-title-remainder>the proceedings of a workshop</md-title-remainder>
<md-date>1974</md-date>
+<md-subject>Radioisotope scanning</md-subject>
+<md-subject>Scintillation cameras</md-subject>
+<md-subject>Imaging systems in medicine</md-subject>
<md-description tag="504">Includes bibliographical references and index</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
<md-title>The use of passwords for controlled access to computer resources</md-title>
<md-date>1977</md-date>
-<md-author>Wood, Helen M</md-author><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
+<md-author>Wood, Helen M</md-author>
+<md-subject>Computers</md-subject><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>The use of passwords for controlled access to computer resources</md-title>
<md-date>1977</md-date>
<md-author>Wood, Helen M</md-author>
+<md-subject>Computers</md-subject>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
YYYYYYYYY</md-test-usersetting-2></location>
<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
<md-title-remainder>proceedings of the workshop</md-title-remainder>
<md-date>1977</md-date>
+<md-subject>Tomography</md-subject>
<md-description>Includes bibliographical references and index</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
<md-title-remainder>proceedings of the workshop</md-title-remainder>
<md-date>1977</md-date>
+<md-subject>Tomography</md-subject>
<md-description tag="504">Includes bibliographical references and index</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
<md-title>Computer processing of dynamic images from an Anger scintillation camera</md-title>
<md-title-remainder>the proceedings of a workshop</md-title-remainder>
<md-date>1974</md-date>
+<md-subject>Radioisotope scanning</md-subject>
+<md-subject>Scintillation cameras</md-subject>
+<md-subject>Imaging systems in medicine</md-subject>
<md-description>Includes bibliographical references and index</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>Computer processing of dynamic images from an Anger scintillation camera</md-title>
<md-title-remainder>the proceedings of a workshop</md-title-remainder>
<md-date>1974</md-date>
+<md-subject>Radioisotope scanning</md-subject>
+<md-subject>Scintillation cameras</md-subject>
+<md-subject>Imaging systems in medicine</md-subject>
<md-description tag="504">Includes bibliographical references and index</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
<md-title>The religious teachers of Greece</md-title>
<md-date>1972</md-date>
<md-author>Adam, James</md-author>
+<md-subject>Greek literature</md-subject>
+<md-subject>Philosophy, Ancient</md-subject>
+<md-subject>Greece</md-subject>
<md-description>Reprint of the 1909 ed., which was issued as the 1904-1906 Gifford lectures</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>The religious teachers of Greece</md-title>
<md-date>1972</md-date>
<md-author>Adam, James</md-author>
+<md-subject>Greek literature</md-subject>
+<md-subject>Philosophy, Ancient</md-subject>
+<md-subject>Greece</md-subject>
<md-description tag="500">Reprint of the 1909 ed., which was issued as the 1904-1906 Gifford lectures</md-description>
<md-description tag="504">Includes bibliographical references</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
YYYYYYYYY</md-test-usersetting-2></location>
-<relevance>320000</relevance>
+<relevance>620000</relevance>
<recid>content: title the religious teachers of greece author adam james medium book</recid>
</hit>
</show>
\ No newline at end of file
<md-title>The religious teachers of Greece</md-title>
<md-date>1972</md-date>
<md-author>Adam, James</md-author>
+<md-subject>Greek literature</md-subject>
+<md-subject>Philosophy, Ancient</md-subject>
+<md-subject>Greece</md-subject>
<md-description>Reprint of the 1909 ed., which was issued as the 1904-1906 Gifford lectures</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>The religious teachers of Greece</md-title>
<md-date>1972</md-date>
<md-author>Adam, James</md-author>
+<md-subject>Greek literature</md-subject>
+<md-subject>Philosophy, Ancient</md-subject>
+<md-subject>Greece</md-subject>
<md-description tag="500">Reprint of the 1909 ed., which was issued as the 1904-1906 Gifford lectures</md-description>
<md-description tag="504">Includes bibliographical references</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
YYYYYYYYY</md-test-usersetting-2></location>
-<relevance>120000</relevance>
+<relevance>420000</relevance>
<recid>content: title the religious teachers of greece author adam james medium book</recid>
</hit>
</show>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<search><status>OK</status></search>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<bytarget><status>OK</status>
+<target><id>z3950.indexdata.com/marc</id>
+<name>Index Data MARC test server</name>
+<hits>1</hits>
+<diagnostic>0</diagnostic>
+<records>1</records>
+<state>Client_Idle</state>
+</target></bytarget>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<show><status>OK</status>
+<activeclients>0</activeclients>
+<merged>1</merged>
+<total>1</total>
+<start>0</start>
+<num>1</num>
+<hit>
+
+<md-title>The religious teachers of Greece</md-title>
+<md-date>1972</md-date>
+<md-author>Adam, James</md-author>
+<md-subject>Greek literature</md-subject>
+<md-subject>Philosophy, Ancient</md-subject>
+<md-subject>Greece</md-subject>
+<md-description>Reprint of the 1909 ed., which was issued as the 1904-1906 Gifford lectures</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
+<md-title>The religious teachers of Greece</md-title>
+<md-date>1972</md-date>
+<md-author>Adam, James</md-author>
+<md-subject>Greek literature</md-subject>
+<md-subject>Philosophy, Ancient</md-subject>
+<md-subject>Greece</md-subject>
+<md-description tag="500">Reprint of the 1909 ed., which was issued as the 1904-1906 Gifford lectures</md-description>
+<md-description tag="504">Includes bibliographical references</md-description>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
+<md-test-usersetting-2>test-usersetting-2 data:
+ YYYYYYYYY</md-test-usersetting-2></location>
+<relevance>420000</relevance>
+<recid>content: title the religious teachers of greece author adam james medium book</recid>
+</hit>
+</show>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<error code="8" msg="No targets"></error>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<bytarget><status>OK</status></bytarget>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<show><status>OK</status>
+<activeclients>0</activeclients>
+<merged>0</merged>
+<total>0</total>
+<start>0</start>
+<num>0</num>
+</show>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<search><status>OK</status></search>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<bytarget><status>OK</status>
+<target><id>z3950.indexdata.com/marc</id>
+<name>Index Data MARC test server</name>
+<hits>1</hits>
+<diagnostic>0</diagnostic>
+<records>1</records>
+<state>Client_Idle</state>
+</target></bytarget>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<show><status>OK</status>
+<activeclients>0</activeclients>
+<merged>1</merged>
+<total>1</total>
+<start>0</start>
+<num>1</num>
+<hit>
+
+<md-title>The religious teachers of Greece</md-title>
+<md-date>1972</md-date>
+<md-author>Adam, James</md-author>
+<md-subject>Greek literature</md-subject>
+<md-subject>Philosophy, Ancient</md-subject>
+<md-subject>Greece</md-subject>
+<md-description>Reprint of the 1909 ed., which was issued as the 1904-1906 Gifford lectures</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
+<md-title>The religious teachers of Greece</md-title>
+<md-date>1972</md-date>
+<md-author>Adam, James</md-author>
+<md-subject>Greek literature</md-subject>
+<md-subject>Philosophy, Ancient</md-subject>
+<md-subject>Greece</md-subject>
+<md-description tag="500">Reprint of the 1909 ed., which was issued as the 1904-1906 Gifford lectures</md-description>
+<md-description tag="504">Includes bibliographical references</md-description>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
+<md-test-usersetting-2>test-usersetting-2 data:
+ YYYYYYYYY</md-test-usersetting-2></location>
+<relevance>420000</relevance>
+<recid>content: title the religious teachers of greece author adam james medium book</recid>
+</hit>
+</show>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<search><status>OK</status></search>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<show><status>OK</status>
+<activeclients>0</activeclients>
+<merged>1</merged>
+<total>10</total>
+<start>0</start>
+<num>1</num>
+<hit>
+
+<md-title>Washington metropolitan area rail computer feasibility study;</md-title>
+<md-title-remainder>final report</md-title-remainder>
+<md-date>1971</md-date>
+<md-author>Englund, Carl R</md-author>
+<md-subject>Railroads</md-subject>
+<md-description>"Contract DOT-UT-10003."</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
+<md-title>Washington metropolitan area rail computer feasibility study;</md-title>
+<md-title-remainder>final report</md-title-remainder>
+<md-date>1971</md-date>
+<md-author>Englund, Carl R</md-author>
+<md-subject>Railroads</md-subject>
+<md-description tag="500">"Contract DOT-UT-10003."</md-description>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
+<md-test-usersetting-2>test-usersetting-2 data:
+ YYYYYYYYY</md-test-usersetting-2></location>
+<relevance>85714</relevance>
+<recid>content: title washington metropolitan area rail computer feasibility study author englund carl r medium book</recid>
+</hit>
+</show>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<search><status>OK</status></search>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<show><status>OK</status>
+<activeclients>0</activeclients>
+<merged>4</merged>
+<total>10</total>
+<start>0</start>
+<num>4</num>
+<hit>
+
+<md-title>Computer science & technology</md-title>
+<md-title-remainder>proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976</md-title-remainder>
+<md-date>1977</md-date>
+<md-subject>Optical pattern recognition</md-subject><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
+<md-title>Computer science & technology</md-title>
+<md-title-remainder>proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976</md-title-remainder>
+<md-date>1977</md-date>
+<md-subject>Optical pattern recognition</md-subject>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
+<md-test-usersetting-2>test-usersetting-2 data:
+ YYYYYYYYY</md-test-usersetting-2></location>
+<relevance>57536</relevance>
+<recid>content: title computer science technology author medium book</recid>
+</hit>
+<hit>
+
+<md-title>The Computer Bible</md-title>
+<md-date>1973-1980</md-date>
+<md-subject>Bible. O.T</md-subject>
+<md-subject>Bible</md-subject>
+<md-description>Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
+<md-title>The Computer Bible</md-title>
+<md-date>1973-1980</md-date>
+<md-subject>Bible. O.T</md-subject>
+<md-subject>Bible</md-subject>
+<md-description tag="500">Hebrew and Greek; introductions in English</md-description>
+<md-description tag="500">Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
+<md-test-usersetting-2>test-usersetting-2 data:
+ YYYYYYYYY</md-test-usersetting-2></location>
+<relevance>57536</relevance>
+<recid>content: title the computer bible author medium book</recid>
+</hit>
+<hit>
+
+<md-title>The use of passwords for controlled access to computer resources</md-title>
+<md-date>1977</md-date>
+<md-author>Wood, Helen M</md-author>
+<md-subject>Computers</md-subject><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
+<md-title>The use of passwords for controlled access to computer resources</md-title>
+<md-date>1977</md-date>
+<md-author>Wood, Helen M</md-author>
+<md-subject>Computers</md-subject>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
+<md-test-usersetting-2>test-usersetting-2 data:
+ YYYYYYYYY</md-test-usersetting-2></location>
+<relevance>17260</relevance>
+<recid>content: title the use of passwords for controlled access to computer resources author wood helen m medium book</recid>
+</hit>
+<hit>
+
+<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
+<md-title-remainder>proceedings of the workshop</md-title-remainder>
+<md-date>1977</md-date>
+<md-subject>Tomography</md-subject>
+<md-description>Includes bibliographical references and index</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
+<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
+<md-title-remainder>proceedings of the workshop</md-title-remainder>
+<md-date>1977</md-date>
+<md-subject>Tomography</md-subject>
+<md-description tag="504">Includes bibliographical references and index</md-description>
+<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
+<md-test-usersetting-2>test-usersetting-2 data:
+ YYYYYYYYY</md-test-usersetting-2></location>
+<relevance>0</relevance>
+<recid>content: title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book</recid>
+</hit>
+</show>
\ No newline at end of file
<md-title-remainder>final report</md-title-remainder>
<md-date>1971</md-date>
<md-author>Englund, Carl R</md-author>
+<md-subject>Railroads</md-subject>
<md-description>"Contract DOT-UT-10003."</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>Washington metropolitan area rail computer feasibility study;</md-title>
<md-title-remainder>final report</md-title-remainder>
<md-date>1971</md-date>
<md-author>Englund, Carl R</md-author>
+<md-subject>Railroads</md-subject>
<md-description tag="500">"Contract DOT-UT-10003."</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
<md-title>The use of passwords for controlled access to computer resources</md-title>
<md-date>1977</md-date>
-<md-author>Wood, Helen M</md-author><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
+<md-author>Wood, Helen M</md-author>
+<md-subject>Computers</md-subject><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>The use of passwords for controlled access to computer resources</md-title>
<md-date>1977</md-date>
<md-author>Wood, Helen M</md-author>
+<md-subject>Computers</md-subject>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
YYYYYYYYY</md-test-usersetting-2></location>
<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
<md-title-remainder>proceedings of the workshop</md-title-remainder>
<md-date>1977</md-date>
+<md-subject>Tomography</md-subject>
<md-description>Includes bibliographical references and index</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
<md-title-remainder>proceedings of the workshop</md-title-remainder>
<md-date>1977</md-date>
+<md-subject>Tomography</md-subject>
<md-description tag="504">Includes bibliographical references and index</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
<md-title-remainder>a portfolio of thematic computer maps</md-title-remainder>
<md-date>1974</md-date>
<md-author>Mairs, John W</md-author>
+<md-subject>Cartography</md-subject>
+<md-subject>Puget Sound region (Wash.)</md-subject>
<md-description>Scale of maps ca. 1:1,000,000</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>The Puget Sound Region</md-title>
<md-title-remainder>a portfolio of thematic computer maps</md-title-remainder>
<md-date>1974</md-date>
<md-author>Mairs, John W</md-author>
+<md-subject>Cartography</md-subject>
+<md-subject>Puget Sound region (Wash.)</md-subject>
<md-description tag="500">Scale of maps ca. 1:1,000,000</md-description>
<md-description tag="504">Bibliography: p. 4</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-title>A plan for community college computer development</md-title>
<md-date>1971</md-date>
+<md-subject>Universities and colleges</md-subject>
+<md-subject>Community colleges</md-subject>
<md-description>Cover title</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>A plan for community college computer development</md-title>
<md-date>1971</md-date>
+<md-subject>Universities and colleges</md-subject>
+<md-subject>Community colleges</md-subject>
<md-description tag="500">Cover title</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
<md-title>Computer science & technology</md-title>
<md-title-remainder>proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976</md-title-remainder>
-<md-date>1977</md-date><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
+<md-date>1977</md-date>
+<md-subject>Optical pattern recognition</md-subject><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>Computer science & technology</md-title>
<md-title-remainder>proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976</md-title-remainder>
<md-date>1977</md-date>
+<md-subject>Optical pattern recognition</md-subject>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
YYYYYYYYY</md-test-usersetting-2></location>
<md-title>Computer processing of dynamic images from an Anger scintillation camera</md-title>
<md-title-remainder>the proceedings of a workshop</md-title-remainder>
<md-date>1974</md-date>
+<md-subject>Radioisotope scanning</md-subject>
+<md-subject>Scintillation cameras</md-subject>
+<md-subject>Imaging systems in medicine</md-subject>
<md-description>Includes bibliographical references and index</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>Computer processing of dynamic images from an Anger scintillation camera</md-title>
<md-title-remainder>the proceedings of a workshop</md-title-remainder>
<md-date>1974</md-date>
+<md-subject>Radioisotope scanning</md-subject>
+<md-subject>Scintillation cameras</md-subject>
+<md-subject>Imaging systems in medicine</md-subject>
<md-description tag="504">Includes bibliographical references and index</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
<md-title>The Computer Bible</md-title>
<md-date>1973-1980</md-date>
+<md-subject>Bible. O.T</md-subject>
+<md-subject>Bible</md-subject>
<md-description>Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>The Computer Bible</md-title>
<md-date>1973-1980</md-date>
+<md-subject>Bible. O.T</md-subject>
+<md-subject>Bible</md-subject>
<md-description tag="500">Hebrew and Greek; introductions in English</md-description>
<md-description tag="500">Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-title>The Computer Bible</md-title>
<md-date>1973-1980</md-date>
+<md-subject>Bible. O.T</md-subject>
+<md-subject>Bible</md-subject>
<md-description>Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>The Computer Bible</md-title>
<md-date>1973-1980</md-date>
+<md-subject>Bible. O.T</md-subject>
+<md-subject>Bible</md-subject>
<md-description tag="500">Hebrew and Greek; introductions in English</md-description>
<md-description tag="500">Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-title>Computer processing of dynamic images from an Anger scintillation camera</md-title>
<md-title-remainder>the proceedings of a workshop</md-title-remainder>
<md-date>1974</md-date>
+<md-subject>Radioisotope scanning</md-subject>
+<md-subject>Scintillation cameras</md-subject>
+<md-subject>Imaging systems in medicine</md-subject>
<md-description>Includes bibliographical references and index</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>Computer processing of dynamic images from an Anger scintillation camera</md-title>
<md-title-remainder>the proceedings of a workshop</md-title-remainder>
<md-date>1974</md-date>
+<md-subject>Radioisotope scanning</md-subject>
+<md-subject>Scintillation cameras</md-subject>
+<md-subject>Imaging systems in medicine</md-subject>
<md-description tag="504">Includes bibliographical references and index</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
<md-title>Computer science & technology</md-title>
<md-title-remainder>proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976</md-title-remainder>
-<md-date>1977</md-date><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
+<md-date>1977</md-date>
+<md-subject>Optical pattern recognition</md-subject><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>Computer science & technology</md-title>
<md-title-remainder>proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976</md-title-remainder>
<md-date>1977</md-date>
+<md-subject>Optical pattern recognition</md-subject>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
YYYYYYYYY</md-test-usersetting-2></location>
<md-title>A plan for community college computer development</md-title>
<md-date>1971</md-date>
+<md-subject>Universities and colleges</md-subject>
+<md-subject>Community colleges</md-subject>
<md-description>Cover title</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>A plan for community college computer development</md-title>
<md-date>1971</md-date>
+<md-subject>Universities and colleges</md-subject>
+<md-subject>Community colleges</md-subject>
<md-description tag="500">Cover title</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
<md-title-remainder>a portfolio of thematic computer maps</md-title-remainder>
<md-date>1974</md-date>
<md-author>Mairs, John W</md-author>
+<md-subject>Cartography</md-subject>
+<md-subject>Puget Sound region (Wash.)</md-subject>
<md-description>Scale of maps ca. 1:1,000,000</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>The Puget Sound Region</md-title>
<md-title-remainder>a portfolio of thematic computer maps</md-title-remainder>
<md-date>1974</md-date>
<md-author>Mairs, John W</md-author>
+<md-subject>Cartography</md-subject>
+<md-subject>Puget Sound region (Wash.)</md-subject>
<md-description tag="500">Scale of maps ca. 1:1,000,000</md-description>
<md-description tag="504">Bibliography: p. 4</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
<md-title-remainder>proceedings of the workshop</md-title-remainder>
<md-date>1977</md-date>
+<md-subject>Tomography</md-subject>
<md-description>Includes bibliographical references and index</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>Reconstruction tomography in diagnostic radiology and nuclear medicine</md-title>
<md-title-remainder>proceedings of the workshop</md-title-remainder>
<md-date>1977</md-date>
+<md-subject>Tomography</md-subject>
<md-description tag="504">Includes bibliographical references and index</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
<md-title>The use of passwords for controlled access to computer resources</md-title>
<md-date>1977</md-date>
-<md-author>Wood, Helen M</md-author><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
+<md-author>Wood, Helen M</md-author>
+<md-subject>Computers</md-subject><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>The use of passwords for controlled access to computer resources</md-title>
<md-date>1977</md-date>
<md-author>Wood, Helen M</md-author>
+<md-subject>Computers</md-subject>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
YYYYYYYYY</md-test-usersetting-2></location>
<md-title-remainder>final report</md-title-remainder>
<md-date>1971</md-date>
<md-author>Englund, Carl R</md-author>
+<md-subject>Railroads</md-subject>
<md-description>"Contract DOT-UT-10003."</md-description><location id="z3950.indexdata.com/marc" name="Index Data MARC test server">
<md-title>Washington metropolitan area rail computer feasibility study;</md-title>
<md-title-remainder>final report</md-title-remainder>
<md-date>1971</md-date>
<md-author>Englund, Carl R</md-author>
+<md-subject>Railroads</md-subject>
<md-description tag="500">"Contract DOT-UT-10003."</md-description>
<md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
<md-test-usersetting-2>test-usersetting-2 data:
<term><name>Wood, Helen M.</name><frequency>1</frequency></term>
</list>
<list name="subject">
+<term><name>Bible</name><frequency>1</frequency></term>
+<term><name>Bible. O.t</name><frequency>1</frequency></term>
<term><name>Cartography</name><frequency>1</frequency></term>
<term><name>Community Colleges</name><frequency>1</frequency></term>
<term><name>Computers</name><frequency>1</frequency></term>
<term><name>Imaging Systems In Medicine</name><frequency>1</frequency></term>
<term><name>Optical Pattern Recognition</name><frequency>1</frequency></term>
+<term><name>Puget Sound Region (Wash.)</name><frequency>1</frequency></term>
<term><name>Radioisotope Scanning</name><frequency>1</frequency></term>
<term><name>Railroads</name><frequency>1</frequency></term>
<term><name>Scintillation Cameras</name><frequency>1</frequency></term>
# Source and object modules
PAZPAR2_OBJS = \
+ "$(OBJDIR)\getaddrinfo.obj" \
+ "$(OBJDIR)\host.obj" \
"$(OBJDIR)\pazpar2.obj" \
"$(OBJDIR)\pazpar2_config.obj" \
"$(OBJDIR)\http.obj" \
// create a parameters array and pass it to the pz2's constructor
// then register the form submit event with the pz2.search function
// autoInit is set to true on default
-var usesessions = true;
+var usesessions = false;
var pazpar2path = '/service-proxy/';
var showResponseType = '';
+// Facet configuration
var querys = {'su': '', 'au': '', 'xt': ''};
-var showResponseType = 'json';
+var query_client_server = {'su': 'subject', 'au': 'author', 'xt': 'xtargets'};
+var querys_server = {};
+var useLimit = 1;
+// Fail to get JSON working stabil.
+var showResponseType = 'xml';
if (document.location.hash == '#pazpar2' || document.location.search.match("useproxy=false")) {
- usesessions = false;
+ usesessions = true;
pazpar2path = '/pazpar2/search.pz2';
showResponseType = 'xml';
}
"onrecord": my_onrecord } );
// some state vars
var curPage = 1;
-var recPerPage = 20;
+var recPerPage = 100;
+var recToShowPageSize = 20;
+var recToShow = recToShowPageSize;
+var recIDs = {};
var totalRec = 0;
var curDetRecId = '';
var curDetRecData = null;
authCb, authCb);
}
-function handleKeyPress(e, formId, focusId)
+function handleKeyPress(e)
{
var key;
if(window.event)
if(key == 13 || key == 10)
{
- document.getElementById(formId).submit();
- focusElement = document.getElementById(focusId);
- if (focusElement)
- focusElement.focus();
- return false;
+ button = document.getElementById('button');
+ button.focus();
+ button.click();
+
+ return false;
}
else
return true;
my_paz.bytarget();
}
+function showMoreRecords() {
+ var i = recToShow;
+ recToShow += recToShowPageSize;
+ for ( ; i < recToShow && i < recPerPage; i++) {
+ var element = document.getElementById(recIDs[i]);
+ if (element)
+ element.style.display = '';
+ }
+ if (i == recPerPage) {
+ var element = document.getElementById('recdiv_END');
+ if (element)
+ element.style.display = 'none';
+ }
+}
+
function my_onshow(data) {
totalRec = data.merged;
// move it out
drawPager(pager);
var results = document.getElementById("results");
-
+
var html = [];
if (data.hits == undefined)
- return ;
+ return ;
+ var style = '';
for (var i = 0; i < data.hits.length; i++) {
var hit = data.hits[i];
- html.push('<li id="recdiv_'+hit.recid+'" >'
- /* +'<span>'+ (i + 1 + recPerPage * (curPage - 1)) +'. </span>' */
- +'<a href="#" id="rec_'+hit.recid
- +'" onclick="showDetails(this.id);return false;">'
- + hit["md-title"] +'</a> ');
- if (hit["md-title-remainder"] !== undefined) {
- html.push('<a href="#">' + hit["md-title-remainder"] + ' </a> ');
- if (hit["md-author"] != undefined) {
- html.push('<a href="#">'+hit["md-author"]+'</a> ');
- }
- else if (hit["md-title-responsibility"] !== undefined) {
- html.push('<a href="#">'+hit["md-title-responsibility"]+'</a> ');
- }
- }
+ var recID = "recdiv_" + hit.recid;
+ //var recID = "recdiv_" + i;
+ recIDs[i] = recID;
+ if (i == recToShow)
+ style = ' style="display:none" ';
+ html.push('<li id="' + recID + '" ' + style + '>'
+ +'<a href="#" id="rec_'+hit.recid
+ +'" onclick="showDetails(this.id);return false;">'
+ + hit["md-title"] +'</a> ');
+ if (hit["md-title-remainder"] !== undefined) {
+ html.push('<a href="#">' + hit["md-title-remainder"] + ' </a> ');
+ }
+ if (hit["md-author"] != undefined) {
+ html.push('<a href="#">'+hit["md-author"]+'</a> ');
+ }
+ else if (hit["md-title-responsibility"] !== undefined) {
+ html.push('<a href="#">'+hit["md-title-responsibility"]+'</a> ');
+ }
if (hit.recid == curDetRecId) {
html.push(renderDetails_iphone(curDetRecData));
}
- html.push('</div>');
+ html.push('</li>');
}
+ // set up "More..." if needed.
+ style = 'display:none';
+ if (recToShow < recPerPage) {
+ style = 'display:block';
+ }
+ html.push('<li id="recdiv_END" style="' + style + '"><a onclick="showMoreRecords()">More...</a></li>');
+
replaceHtml(results, html.join(''));
}
termlists.push('<ul>');
termlists.push('<li><a href="#" onclick="limitOrResetQuery(\'reset_au\',\'All\');return false;">All<a></li>');
for (var i = 0; i < data.author.length && i < AuthorMax; i++ ) {
- termlists.push('<li><a href="#" onclick="limitQuery(\'au\', \'' + data.author[i].name +'\');return false;">'
+ termlists.push('<li><a href="#" onclick="limitOrResetQuery(\'au\', \'' + data.author[i].name +'\');return false;">'
+ data.author[i].name
+ ' ('
+ data.author[i].freq
totalRec = 0;
}
+function getFacets() {
+ var result = "";
+ for (var key in querys_server) {
+ if (result.length > 0)
+ result += ","
+ result += querys_server[key];
+ }
+ return result;
+}
+
function triggerSearch ()
{
- my_paz.search(document.search.query.value, recPerPage, curSort, curFilter);
-/*
- , startWith,
+ // Restore to initial page size
+ recToShow = recToShowPageSize;
+ my_paz.search(document.search.query.value, recPerPage, curSort, curFilter, undefined,
{
"limit" : getFacets()
}
);
-*/
}
function loadSelect ()
}
// limit the query after clicking the facet
+function limitQueryServer(field, value)
+{
+ // Check for client field usage
+ var fieldname = query_client_server[field];
+ if (!fieldname)
+ fieldname = field;
+
+ var newQuery = fieldname + '=' + value.replace(",", "\\,").replace("|", "\\,");
+ // Does it already exists?
+ if (querys_server[fieldname])
+ querys_server[fieldname] += "," + newQuery;
+ else
+ querys_server[fieldname] = newQuery;
+// document.search.query.value += newQuery;
+ onFormSubmitEventHandler();
+ showhide("recordview");
+}
+
+
+
+// limit the query after clicking the facet
function removeQuery (field, value) {
document.search.query.value.replace(' and ' + field + '="' + value + '"', '');
onFormSubmitEventHandler();
// limit the query after clicking the facet
function limitOrResetQuery (field, value, selected) {
- if (field == 'reset_su' || field == 'reset_au') {
- var reset_field = field.substring(6);
- document.search.query.value = document.search.query.value.replace(querys[reset_field], '');
- querys[reset_field] = '';
- onFormSubmitEventHandler();
- showhide("recordview");
- }
- else
- limitQuery(field, value);
+ if (useLimit) {
+ limitOrResetQueryServer(field,value, selected);
+ return ;
+ }
+ if (field == 'reset_su' || field == 'reset_au') {
+ var reset_field = field.substring(6);
+ document.search.query.value = document.search.query.value.replace(querys[reset_field], '');
+ querys[reset_field] = '';
+ onFormSubmitEventHandler();
+ showhide("recordview");
+ }
+ else
+ limitQuery(field, value);
//alert("limitOrResetQuerry: query after: " + document.search.query.value);
}
+// limit the query after clicking the facet
+function limitOrResetQueryServer (field, value, selected) {
+ if (field.substring(0,6) == 'reset_') {
+ var clientname = field.substring(6);
+ var fieldname = query_client_server[clientname];
+ if (!fieldname)
+ fieldname = clientname;
+ delete querys_server[fieldname];
+ onFormSubmitEventHandler();
+ showhide("recordview");
+ }
+ else
+ limitQueryServer(field, value);
+ //alert("limitOrResetQuerry: query after: " + document.search.query.value);
+}
+
+
+
+
// limit by target functions
function limitTarget (id, name)
{
if(key == 13 || key == 10)
{
- document.forms[0].submit()
- document.getElementById('testLink').focus();
+ //document.forms[0].submit();
+ button = document.getElementById('button');
+ button.focus();
+ button.click();
+
+
return false;
}
else
onKeyPress="return handleKeyPress(event)"
maxlength="100"
value="" />
+ <input id="button" type="submit" value="go" />
<a href="#" id="testLink"></a>
</form>
</body>
-</html>
\ No newline at end of file
+</html>
-->
<td width="100%">
<form id="searchForm" name="search" style="display: none">
- <input id="query" type="text" onKeyPress="return handleKeyPress(event, 'searchForm')"/>
- <input id="button" type="submit" value="go" />
+ <input id="query" type="text" onKeyPress="return handleKeyPress(event)" />
+ <input id="button" type="submit" value="go" /><a id="hidden" href=""></a>
</form>
</td>
</tr>
<option value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
- <option value="50" selected="selected">50</option>
+ <option value="50">50</option>
+ <option value="100" selected="selected">100</option>
</select>
per page.
</form>