projects
/
yaz-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:
43a39e3
)
Fix: usage of wrong xml node. Fix string compare. Cosmetic: add newline after xml...
author
Dennis Schafroth
<dennis@indexdata.com>
Fri, 28 Oct 2011 11:57:07 +0000
(13:57 +0200)
committer
Dennis Schafroth
<dennis@indexdata.com>
Fri, 28 Oct 2011 11:57:07 +0000
(13:57 +0200)
src/solr.c
patch
|
blob
|
history
diff --git
a/src/solr.c
b/src/solr.c
index
d3e9c11
..
60df651
100644
(file)
--- a/
src/solr.c
+++ b/
src/solr.c
@@
-204,13
+204,13
@@
static int yaz_solr_decode_facet_counts(ODR o, xmlNodePtr root,
return 0;
}
return 0;
}
-static void yaz_solr_decode_suggestion_values(xmlNodePtr ptr, WRBUF wrbuf)
+static void yaz_solr_decode_suggestion_values(xmlNodePtr listPptr, WRBUF wrbuf)
{
xmlNodePtr node;
{
xmlNodePtr node;
- for (node = ptr; node; node= node->next) {
- if (!strcmp((char*)ptr->name, "lst")) {
+ for (node = listPptr; node; node= node->next) {
+ if (!strcmp((char*) node->name, "lst")) {
xmlNodePtr child;
xmlNodePtr child;
- for (child = ptr->children; child; child= child->next) {
+ for (child = node->children; child; child= child->next) {
if (match_xml_node_attribute(child, "str", "name", "word")) {
wrbuf_puts(wrbuf, "<suggestion>");
extract_text_node(child, wrbuf);
if (match_xml_node_attribute(child, "str", "name", "word")) {
wrbuf_puts(wrbuf, "<suggestion>");
extract_text_node(child, wrbuf);
@@
-236,10
+236,10
@@
static void yaz_solr_decode_misspelled(xmlNodePtr lstPtr, WRBUF wrbuf)
xmlNodePtr node;
for (node = lstPtr; node; node= node->next)
{
xmlNodePtr node;
for (node = lstPtr; node; node= node->next)
{
- if (strcmp((const char*) node->name, "lst")) {
+ if (!strcmp((const char*) node->name, "lst")) {
const char *misspelled = yaz_element_attribute_value_get(node, "lst", "name");
if (misspelled) {
const char *misspelled = yaz_element_attribute_value_get(node, "lst", "name");
if (misspelled) {
- wrbuf_printf(wrbuf, "<misspelled term=\"%s\">", misspelled);
+ wrbuf_printf(wrbuf, "<misspelled term=\"%s\">\n", misspelled);
yaz_solr_decode_suggestion_lst(node->children, wrbuf);
wrbuf_puts(wrbuf, "</misspelled>\n");
}
yaz_solr_decode_suggestion_lst(node->children, wrbuf);
wrbuf_puts(wrbuf, "</misspelled>\n");
}