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
Fix snippets for complete fields, bug #4590
[idzebra-moved-to-github.git]
/
index
/
rank1.c
diff --git
a/index/rank1.c
b/index/rank1.c
index
b4558ef
..
a9da489
100644
(file)
--- a/
index/rank1.c
+++ b/
index/rank1.c
@@
-1,5
+1,5
@@
/* This file is part of the Zebra server.
/* This file is part of the Zebra server.
- Copyright (C) 1994-2009 Index Data
+ Copyright (C) 1994-2011 Index Data
Zebra is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Zebra is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
@@
-17,6
+17,9
@@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <stdio.h>
#include <assert.h>
#ifdef WIN32
#include <stdio.h>
#include <assert.h>
#ifdef WIN32
@@
-186,8
+189,8
@@
static void add(void *set_handle, int seqno, TERMID term)
* score should be between 0 and 1000. If score cannot be obtained
* -1 should be returned.
*/
* score should be between 0 and 1000. If score cannot be obtained
* -1 should be returned.
*/
-static int calc(void *set_handle, zint sysno, zint staticrank,
- int *stop_flag)
+static int calc_1(void *set_handle, zint sysno, zint staticrank,
+ int *stop_flag)
{
int i, lo, divisor, score = 0;
struct rank_set_info *si = (struct rank_set_info *) set_handle;
{
int i, lo, divisor, score = 0;
struct rank_set_info *si = (struct rank_set_info *) set_handle;
@@
-214,6
+217,13
@@
static int calc(void *set_handle, zint sysno, zint staticrank,
return score;
}
return score;
}
+static int calc_2(void *set_handle, zint sysno, zint staticrank,
+ int *stop_flag)
+{
+ int score = calc_1(set_handle, sysno, staticrank, stop_flag);
+ return score - staticrank;
+}
+
/*
* Pseudo-meta code with sequence of calls as they occur in a
* server. Handlers are prefixed by --:
/*
* Pseudo-meta code with sequence of calls as they occur in a
* server. Handlers are prefixed by --:
@@
-232,17
+242,28
@@
static int calc(void *set_handle, zint sysno, zint staticrank,
* server close
*/
* server close
*/
-static struct rank_control rank_control = {
+static struct rank_control rank_1_control = {
"rank-1",
create,
destroy,
begin,
end,
"rank-1",
create,
destroy,
begin,
end,
- calc,
+ calc_1,
+ add,
+};
+struct rank_control *rank_1_class = &rank_1_control;
+
+static struct rank_control rank_2_control = {
+ "rank-2",
+ create,
+ destroy,
+ begin,
+ end,
+ calc_2,
add,
};
add,
};
-struct rank_control *rank_1_class = &rank_control;
+struct rank_control *rank_2_class = &rank_2_control;
/*
* Local variables:
* c-basic-offset: 4
/*
* Local variables:
* c-basic-offset: 4