projects
/
idzebra-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed scan for enabled staticrank.
[idzebra-moved-to-github.git]
/
index
/
safari.c
diff --git
a/index/safari.c
b/index/safari.c
index
41cad30
..
c4398dc
100644
(file)
--- a/
index/safari.c
+++ b/
index/safari.c
@@
-1,4
+1,4
@@
-/* $Id: safari.c,v 1.6 2007-04-16 08:44:32 adam Exp $
+/* $Id: safari.c,v 1.9 2007-04-25 09:38:21 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
Copyright (C) 1995-2007
Index Data ApS
@@
-127,21
+127,25
@@
static int filter_extract(void *clientData, struct recExtractCtrl *p)
(*p->init)(p, &recWord);
if (!fi_gets(fi, line, sizeof(line)-1))
(*p->init)(p, &recWord);
if (!fi_gets(fi, line, sizeof(line)-1))
- return RECCTRL_EXTRACT_ERROR_GENERIC;
+ return RECCTRL_EXTRACT_EOF;
sscanf(line, "%255s", p->match_criteria);
sscanf(line, "%255s", p->match_criteria);
- recWord.index_type = '0';
while (fi_gets(fi, line, sizeof(line)-1))
{
int nor = 0;
char field[40];
while (fi_gets(fi, line, sizeof(line)-1))
{
int nor = 0;
char field[40];
- char *cp;
+ const char *cp = line;
#if 0
yaz_log(YLOG_LOG, "safari line: %s", line);
#endif
#if 0
yaz_log(YLOG_LOG, "safari line: %s", line);
#endif
+ if (*cp >= '0' && *cp <= '9')
+ recWord.index_type = '0'; /* the default is 0 (raw) */
+ else
+ recWord.index_type = *cp++; /* type given */
+
if (tinfo->segments)
{
if (tinfo->segments)
{
- if (sscanf(line, ZINT_FORMAT " " ZINT_FORMAT " " ZINT_FORMAT
+ if (sscanf(cp, ZINT_FORMAT " " ZINT_FORMAT " " ZINT_FORMAT
ZINT_FORMAT " %39s %n",
&recWord.record_id, &recWord.section_id,
&recWord.segment,
ZINT_FORMAT " %39s %n",
&recWord.record_id, &recWord.section_id,
&recWord.segment,
@@
-154,7
+158,7
@@
static int filter_extract(void *clientData, struct recExtractCtrl *p)
}
else
{
}
else
{
- if (sscanf(line, ZINT_FORMAT " " ZINT_FORMAT " " ZINT_FORMAT " %39s %n",
+ if (sscanf(cp, ZINT_FORMAT " " ZINT_FORMAT " " ZINT_FORMAT " %39s %n",
&recWord.record_id, &recWord.section_id, &recWord.seqno,
field, &nor) < 4)
{
&recWord.record_id, &recWord.section_id, &recWord.seqno,
field, &nor) < 4)
{
@@
-162,7
+166,7
@@
static int filter_extract(void *clientData, struct recExtractCtrl *p)
return RECCTRL_EXTRACT_ERROR_GENERIC;
}
}
return RECCTRL_EXTRACT_ERROR_GENERIC;
}
}
- for (cp = line + nor; *cp == ' '; cp++)
+ for (cp = cp + nor; *cp == ' '; cp++)
;
recWord.index_name = field;
recWord.term_buf = cp;
;
recWord.index_name = field;
recWord.term_buf = cp;
@@
-262,7
+266,7
@@
static int filter_retrieve (void *clientData, struct recRetrieveCtrl *p)
filter_ptr = p-filter_buf;
}
}
filter_ptr = p-filter_buf;
}
}
- p->output_format = yaz_oid_sutrs();
+ p->output_format = yaz_oid_recsyn_sutrs;
p->rec_buf = filter_buf;
p->rec_len = filter_ptr;
return 0;
p->rec_buf = filter_buf;
p->rec_len = filter_ptr;
return 0;