-/* $Id: logic.c,v 1.6 2007-04-18 04:07:48 quinn Exp $
+/* $Id: logic.c,v 1.9 2007-04-18 19:45:09 quinn Exp $
Copyright (c) 2006-2007, Index Data.
This file is part of Pazpar2.
0,
30,
"81",
- "Index Data PazPar2 (MasterKey)",
+ "Index Data PazPar2",
VERSION,
600, // 10 minutes
60,
odr_reset(global_parameters.odr_out);
}
+// Recursively traverse query structure to extract terms.
static void pull_terms(NMEM nmem, struct ccl_rpn_node *n, char **termlist, int *num)
{
+ char **words;
+ int numwords;
+ int i;
+
switch (n->kind)
{
case CCL_RPN_AND:
pull_terms(nmem, n->u.p[1], termlist, num);
break;
case CCL_RPN_TERM:
- termlist[(*num)++] = nmem_strdup(nmem, n->u.t.term);
+ nmem_strsplit(nmem, " ", n->u.t.term, &words, &numwords);
+ for (i = 0; i < numwords; i++)
+ termlist[(*num)++] = words[i];
break;
default: // NOOP
break;
se->relevance = 0;
for (cl = se->clients; cl; cl = cl->next)
- {
- if (client_prep_connection(cl))
- {
- if (client_parse_query(cl) < 0) // Query must parse for all targets
- return "QUERY";
- }
- }
+ if (client_parse_query(cl) < 0) // Query must parse for all targets
+ return "QUERY";
+ for (cl = se->clients; cl; cl = cl->next)
+ client_prep_connection(cl);
return 0;
}