case ZOOM_TASK_SEARCH:
yaz_log(YLOG_LOG, "search p=%p", task);
break;
- case ZOOM_TASK_RETRIEVE:
- yaz_log(YLOG_LOG, "retrieve p=%p", task);
- break;
case ZOOM_TASK_CONNECT:
yaz_log(YLOG_LOG, "connect p=%p", task);
break;
xfree(task->u.search.elementSetName);
xfree(task->u.search.schema);
break;
- case ZOOM_TASK_RETRIEVE:
- resultset_destroy(task->u.retrieve.resultset);
- xfree(task->u.retrieve.syntax);
- xfree(task->u.retrieve.elementSetName);
- xfree(task->u.retrieve.schema);
- break;
case ZOOM_TASK_CONNECT:
break;
case ZOOM_TASK_SCAN:
#endif
resultset_use(1);
r->mc_key = 0;
+ r->live_set = 0;
return r;
}
c->reconnect_ok = 1;
}
}
- task = ZOOM_connection_add_task(c, ZOOM_TASK_RETRIEVE);
- task->u.retrieve.resultset = r;
- task->u.retrieve.start = start;
- task->u.retrieve.count = count;
+ task = ZOOM_connection_add_task(c, ZOOM_TASK_SEARCH);
+ task->u.search.resultset = r;
+ task->u.search.start = start;
+ task->u.search.count = count;
syntax = ZOOM_options_get(r->options, "preferredRecordSyntax");
- task->u.retrieve.syntax = syntax ? xstrdup(syntax) : 0;
+ task->u.search.syntax = syntax ? xstrdup(syntax) : 0;
elementSetName = ZOOM_options_get(r->options, "elementSetName");
- task->u.retrieve.elementSetName = elementSetName
+ task->u.search.elementSetName = elementSetName
? xstrdup(elementSetName) : 0;
cp = ZOOM_options_get(r->options, "schema");
- task->u.retrieve.schema = cp ? xstrdup(cp) : 0;
+ task->u.search.schema = cp ? xstrdup(cp) : 0;
ZOOM_resultset_addref(r);
else
ret = ZOOM_connection_Z3950_send_search(c);
break;
- case ZOOM_TASK_RETRIEVE:
- if (c->proto == PROTO_HTTP)
- ret = ZOOM_connection_srw_send_search(c);
- else
- ret = send_Z3950_present(c);
- break;
case ZOOM_TASK_CONNECT:
ret = do_connect(c);
break;
int num_facets;
char **facets_names;
WRBUF mc_key;
+ int live_set;
};
struct facet_term_p {
char *schema;
int recv_search_fired;
} search;
-#define ZOOM_TASK_RETRIEVE 2
- struct {
- int start;
- ZOOM_resultset resultset;
- int count;
- char *syntax;
- char *elementSetName;
- char *schema;
- } retrieve;
#define ZOOM_TASK_CONNECT 3
#define ZOOM_TASK_SCAN 4
struct {
facet_list = yaz_pqf_parse_facet_list(c->odr_out, facets);
schema = c->tasks->u.search.schema;
break;
- case ZOOM_TASK_RETRIEVE:
- resultset = c->tasks->u.retrieve.resultset;
- schema = c->tasks->u.retrieve.schema;
-
- start = &c->tasks->u.retrieve.start;
- count = &c->tasks->u.retrieve.count;
if (*start >= resultset->size)
return zoom_complete;
{
ZOOM_record rec =
ZOOM_record_cache_lookup(resultset, i + *start,
- c->tasks->u.retrieve.syntax,
- c->tasks->u.retrieve.elementSetName,
+ c->tasks->u.search.syntax,
+ c->tasks->u.search.elementSetName,
schema);
if (!rec)
break;
if (res->facetList)
ZOOM_handle_facet_list(resultset, res->facetList);
break;
- case ZOOM_TASK_RETRIEVE:
- resultset = c->tasks->u.retrieve.resultset;
- start = &c->tasks->u.retrieve.start;
- count = &c->tasks->u.retrieve.count;
- syntax = c->tasks->u.retrieve.syntax;
- elementSetName = c->tasks->u.retrieve.elementSetName;
- schema = c->tasks->u.retrieve.schema;
- break;
default:
return zoom_complete;
}
int lslb, ssub, mspn;
const char *syntax;
const char *schema;
- Z_APDU *apdu = zget_APDU(c->odr_out, Z_APDU_searchRequest);
- Z_SearchRequest *search_req = apdu->u.searchRequest;
+ Z_APDU *apdu;
+ Z_SearchRequest *search_req;
const char *elementSetName;
const char *smallSetElementSetName;
const char *mediumSetElementSetName;
assert(c->tasks->which == ZOOM_TASK_SEARCH);
r = c->tasks->u.search.resultset;
+ if (r->live_set)
+ return send_Z3950_present(c);
+
+ apdu = zget_APDU(c->odr_out, Z_APDU_searchRequest);
+ search_req = apdu->u.searchRequest;
yaz_log(c->log_details, "%p ZOOM_connection_send_search set=%p", c, r);
handle_facet_result(c, resultset, sr->additionalSearchInfo);
resultset->size = *sr->resultCount;
+ resultset->live_set = 1;
#if HAVE_LIBMEMCACHED_MEMCACHED_H
if (c->mc_st)
elementSetName = c->tasks->u.search.elementSetName;
schema = c->tasks->u.search.schema;
break;
- case ZOOM_TASK_RETRIEVE:
- resultset = c->tasks->u.retrieve.resultset;
- start = &c->tasks->u.retrieve.start;
- count = &c->tasks->u.retrieve.count;
- syntax = c->tasks->u.retrieve.syntax;
- elementSetName = c->tasks->u.retrieve.elementSetName;
- schema = c->tasks->u.retrieve.schema;
- break;
- default:
return;
}
if (sr && sr->which == Z_Records_NSD)
elementSetName = c->tasks->u.search.elementSetName;
schema = c->tasks->u.search.schema;
break;
- case ZOOM_TASK_RETRIEVE:
- resultset = c->tasks->u.retrieve.resultset;
- start = &c->tasks->u.retrieve.start;
- count = &c->tasks->u.retrieve.count;
- syntax = c->tasks->u.retrieve.syntax;
- elementSetName = c->tasks->u.retrieve.elementSetName;
- schema = c->tasks->u.retrieve.schema;
- break;
default:
return zoom_complete;
}