projects
/
pazpar2-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
0cd7ed4
)
New method to detect re-search required. Cosmetic: Rename q to query. in client_start...
author
Dennis Schafroth
<dennis@indexdata.com>
Wed, 3 Oct 2012 14:25:48 +0000
(16:25 +0200)
committer
Dennis Schafroth
<dennis@indexdata.com>
Wed, 3 Oct 2012 14:25:48 +0000
(16:25 +0200)
src/client.c
patch
|
blob
|
history
diff --git
a/src/client.c
b/src/client.c
index
ace376f
..
30ef040
100644
(file)
--- a/
src/client.c
+++ b/
src/client.c
@@
-752,7
+752,7
@@
void client_start_search(struct client *cl)
const char *opt_preferred = session_setting_oneval(sdb, PZ_PREFERRED);
const char *extra_args = session_setting_oneval(sdb, PZ_EXTRA_ARGS);
const char *opt_present_chunk = session_setting_oneval(sdb, PZ_PRESENT_CHUNK);
const char *opt_preferred = session_setting_oneval(sdb, PZ_PREFERRED);
const char *extra_args = session_setting_oneval(sdb, PZ_EXTRA_ARGS);
const char *opt_present_chunk = session_setting_oneval(sdb, PZ_PRESENT_CHUNK);
- ZOOM_query q;
+ ZOOM_query query;
char maxrecs_str[24], startrecs_str[24], present_chunk_str[24];
int present_chunk = 20; // Default chunk size
if (opt_present_chunk && strcmp(opt_present_chunk,"")) {
char maxrecs_str[24], startrecs_str[24], present_chunk_str[24];
int present_chunk = 20; // Default chunk size
if (opt_present_chunk && strcmp(opt_present_chunk,"")) {
@@
-813,26
+813,26
@@
void client_start_search(struct client *cl)
/* facets definition is in PQF */
client_set_facets_request(cl, link);
/* facets definition is in PQF */
client_set_facets_request(cl, link);
- q = ZOOM_query_create();
+ query = ZOOM_query_create();
if (cl->cqlquery)
{
yaz_log(YLOG_LOG, "Client %s: Search CQL: %s", client_get_id(cl), cl->cqlquery);
if (cl->cqlquery)
{
yaz_log(YLOG_LOG, "Client %s: Search CQL: %s", client_get_id(cl), cl->cqlquery);
- ZOOM_query_cql(q, cl->cqlquery);
+ ZOOM_query_cql(query, cl->cqlquery);
if (*opt_sort)
if (*opt_sort)
- ZOOM_query_sortby(q, opt_sort);
+ ZOOM_query_sortby(query, opt_sort);
}
else
{
yaz_log(YLOG_LOG, "Client %s: Search PQF: %s", client_get_id(cl), cl->pquery);
}
else
{
yaz_log(YLOG_LOG, "Client %s: Search PQF: %s", client_get_id(cl), cl->pquery);
- ZOOM_query_prefix(q, cl->pquery);
+ ZOOM_query_prefix(query, cl->pquery);
}
if (se->sorted_results)
{ /* first entry is current sorting ! */
const char *sort_strategy_and_spec =
}
if (se->sorted_results)
{ /* first entry is current sorting ! */
const char *sort_strategy_and_spec =
- get_strategy_plus_sort(cl, se->sorted_results->field);
+ get_strategy_plus_sort(cl, se->sorted_results->name);
int increasing = se->sorted_results->increasing;
int increasing = se->sorted_results->increasing;
- // int position = se->sorted_results->position;
+ // int position = se->sorted_results->type;
if (sort_strategy_and_spec && strlen(sort_strategy_and_spec) < 40)
{
char spec[50], *p;
if (sort_strategy_and_spec && strlen(sort_strategy_and_spec) < 40)
{
char spec[50], *p;
@@
-848,17
+848,17
@@
void client_start_search(struct client *cl)
else
strcat(p, " >");
yaz_log(YLOG_LOG, "Client %s: applying sorting %s %s", client_get_id(cl), spec, p);
else
strcat(p, " >");
yaz_log(YLOG_LOG, "Client %s: applying sorting %s %s", client_get_id(cl), spec, p);
- ZOOM_query_sortby2(q, spec, p);
+ ZOOM_query_sortby2(query, spec, p);
}
}
else
{
}
}
else
{
- /* no native sorting.. If this is not the first search, then
- skip it entirely */
+ /* no native sorting.. If this is not the first search, then skip it entirely */
if (se->sorted_results->next)
{
if (se->sorted_results->next)
{
+ // TODO this seems wrong. Need to re-ingest instead?
yaz_log(YLOG_DEBUG,"Client %s: Do not (re)search anyway", client_get_id(cl));
yaz_log(YLOG_DEBUG,"Client %s: Do not (re)search anyway", client_get_id(cl));
- ZOOM_query_destroy(q);
+ ZOOM_query_destroy(query);
return;
}
}
return;
}
}
@@
-867,8
+867,8
@@
void client_start_search(struct client *cl)
client_set_state(cl, Client_Working);
cl->hits = 0;
cl->record_offset = 0;
client_set_state(cl, Client_Working);
cl->hits = 0;
cl->record_offset = 0;
- rs = ZOOM_connection_search(link, q);
- ZOOM_query_destroy(q);
+ rs = ZOOM_connection_search(link, query);
+ ZOOM_query_destroy(query);
ZOOM_resultset_destroy(cl->resultset);
cl->resultset = rs;
connection_continue(co);
ZOOM_resultset_destroy(cl->resultset);
cl->resultset = rs;
connection_continue(co);
@@
-1497,6
+1497,11
@@
static void client_suggestions_destroy(struct client *cl)
nmem_destroy(nmem);
}
nmem_destroy(nmem);
}
+int client_test_sort_order(struct client *cl, struct reclist_sortparms *sp)
+{
+ //TODO implement correctly.
+ return 1;
+}
/*
* Local variables:
* c-basic-offset: 4
/*
* Local variables:
* c-basic-offset: 4