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
For approx_limit == 0, use unlimited hit count
[idzebra-moved-to-github.git]
/
index
/
zebraapi.c
diff --git
a/index/zebraapi.c
b/index/zebraapi.c
index
f87f209
..
9a85e32
100644
(file)
--- a/
index/zebraapi.c
+++ b/
index/zebraapi.c
@@
-1,4
+1,4
@@
-/* $Id: zebraapi.c,v 1.173 2005-06-02 11:59:53 adam Exp $
+/* $Id: zebraapi.c,v 1.176 2005-06-10 10:55:18 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
Copyright (C) 1995-2005
Index Data ApS
@@
-115,6
+115,7
@@
ZebraHandle zebra_open (ZebraService zs)
zh->num_basenames = 0;
zh->basenames = 0;
zh->num_basenames = 0;
zh->basenames = 0;
+ zh->approx_limit = 1000000000;
zh->trans_no = 0;
zh->trans_w_no = 0;
zh->trans_no = 0;
zh->trans_w_no = 0;
@@
-864,6
+865,14
@@
ZEBRA_RES zebra_select_databases (ZebraHandle zh, int num_bases,
return ZEBRA_OK;
}
return ZEBRA_OK;
}
+ZEBRA_RES zebra_set_approx_limit(ZebraHandle zh, zint approx_limit)
+{
+ if (approx_limit == 0)
+ approx_limit = 2000000000;
+ zh->approx_limit = approx_limit;
+ return ZEBRA_OK;
+}
+
ZEBRA_RES zebra_search_RPN(ZebraHandle zh, ODR o, Z_RPNQuery *query,
const char *setname, zint *hits)
{
ZEBRA_RES zebra_search_RPN(ZebraHandle zh, ODR o, Z_RPNQuery *query,
const char *setname, zint *hits)
{
@@
-944,14
+953,18
@@
ZEBRA_RES zebra_records_retrieve(ZebraHandle zh, ODR stream,
{
char *buf;
int len;
{
char *buf;
int len;
+ zebra_snippets *hit_snippet = zebra_snippets_create();
- zebra_get_hit_vector(zh, setname, poset[i].sysno);
+ zebra_snippets_hit_vector(zh, setname, poset[i].sysno,
+ hit_snippet);
recs[i].errCode =
zebra_record_fetch(zh, poset[i].sysno, poset[i].score,
recs[i].errCode =
zebra_record_fetch(zh, poset[i].sysno, poset[i].score,
+ hit_snippet,
stream, input_format, comp,
&recs[i].format, &buf, &len,
&recs[i].base, &recs[i].errString);
stream, input_format, comp,
&recs[i].format, &buf, &len,
&recs[i].base, &recs[i].errString);
+
recs[i].len = len;
if (len > 0)
{
recs[i].len = len;
if (len > 0)
{
@@
-962,6
+975,7
@@
ZEBRA_RES zebra_records_retrieve(ZebraHandle zh, ODR stream,
recs[i].buf = buf;
recs[i].score = poset[i].score;
recs[i].sysno = poset[i].sysno;
recs[i].buf = buf;
recs[i].score = poset[i].score;
recs[i].sysno = poset[i].sysno;
+ zebra_snippets_destroy(hit_snippet);
}
else
{
}
else
{