24 #define SOLR_MAX_PARAMETERS 100
27 #include <libxml/parser.h>
28 #include <libxml/tree.h>
32 for (child = node->children; child ; child = child->next)
34 if (child->type == XML_TEXT_NODE)
35 wrbuf_puts(wrbuf, (
const char *) child->content);
41 const char *node_name,
const char *attribute_name,
const char *value)
43 const char *attribute_value;
45 if (strcmp((
const char*) ptr->name, node_name))
51 if (attribute_value && !strcmp(attribute_value, value))
68 for (node = ptr->children; node; node = node->next)
69 if (node->type == XML_ELEMENT_NODE)
75 for (node = ptr->children; node; node = node->next)
77 if (node->type == XML_ELEMENT_NODE)
80 xmlBufferPtr buf = xmlBufferCreate();
81 xmlNode *tmp = xmlCopyNode(node, 1);
83 xmlNodeDump(buf, tmp->doc, tmp, 0, 0);
107 struct _xmlAttr *attr;
108 for (attr = ptr->properties; attr; attr = attr->next)
109 if (attr->children && attr->children->type == XML_TEXT_NODE)
111 if (!strcmp((
const char *) attr->name,
"numFound"))
114 (
const char *) attr->children->content));
116 else if (!strcmp((
const char *) attr->name,
"start"))
118 start =
odr_atoi((
const char *) attr->children->content);
136 for (child = node->children; child ; child = child->next)
138 if (child->type == XML_TEXT_NODE)
139 wrbuf_puts(wrbuf, (
const char *) child->content);
158 for (node = ptr->children; node; node = node->next)
162 for (node = ptr->children; node; node = node->next)
177 for (ptr = root->children; ptr; ptr = ptr->next)
184 for (node = ptr->children; node; node= node->next)
190 for (node = ptr->children; node; node= node->next)
207 for (node = listPptr;
node; node= node->next) {
208 if (!strcmp((
char*) node->name,
"lst")) {
210 for (child = node->children; child; child= child->next) {
224 for (node = lstPtr;
node; node= node->next) {
234 for (node = lstPtr;
node; node= node->next)
236 if (!strcmp((
const char*) node->name,
"lst")) {
239 wrbuf_printf(wrbuf,
"<misspelled term=\"%s\">\n", misspelled);
252 for (ptr = spellcheckPtr->children; ptr; ptr = ptr->next)
271 for (node = ptr->children; node; node = node->next)
272 if (node->type == XML_ELEMENT_NODE) {
278 for (node = ptr->children; node; node = node->next)
279 if (node->type == XML_ELEMENT_NODE && !strcmp((
const char *) node->name,
"int"))
285 for (node = ptr->children; node; node = node->next)
287 if (node->type == XML_ELEMENT_NODE && !strcmp((
const char *) node->name,
"int"))
299 pos = strchr(val,
'^');
326 xmlDocPtr doc = xmlParseMemory(content_buf, content_len);
339 xmlNodePtr root = xmlDocGetRootElement(doc);
344 else if (strcmp((
const char *) root->name,
"response"))
353 for (ptr = root->children; ptr; ptr = ptr->next)
355 if (ptr->type == XML_ELEMENT_NODE &&
356 !strcmp((
const char *) ptr->name,
"result")) {
361 if (ptr->type == XML_ELEMENT_NODE &&
379 ret = rc_result + rc_facets;
393 ODR encode,
char **
name,
char **value,
int *i,
411 if (attr_values.
limit > 0)
418 olimit = attr_values.
limit;
430 ODR encode,
char **
name,
char **value,
434 for (index = 0; index < facet_list->
num; index++)
446 ODR encode,
const char *charset)
448 const char *solr_op = 0;
518 pos = strchr(q,
':');
535 "terms.sort",
"index");
548 value[i] = ea->
value;
561 strlen(uri_args) + strlen(solr_op) + 4);
563 sprintf(path,
"%s/%s?%s", hreq->
path, solr_op, uri_args);
567 "text/xml", charset);