IDZEBRA 2.2.11
rankstatic.c File Reference
#include <stdio.h>
#include <assert.h>
#include <limits.h>
#include "index.h"
#include "rank.h"

Go to the source code of this file.

Data Structures

struct  rank_set_info

Functions

static void * create (ZebraHandle zh)
static void destroy (struct zebra_register *reg, void *class_handle)
static void * begin (struct zebra_register *reg, void *class_handle, RSET rset, NMEM nmem, TERMID *terms, int numterms)
static void end (struct zebra_register *reg, void *set_handle)
static void add (void *set_handle, int seqno, TERMID term)
static int calc (void *set_handle, zint sysno, zint staticrank, int *stop_flag)

Variables

static int log_level = 0
static int log_initialized = 0
static struct rank_control rank_control
struct rank_control * rank_static_class = &rank_control

Function Documentation

◆ add()

void add ( void * set_handle,
int seqno,
TERMID term )
static

add: Called for each word occurence in a result set. This routine should be as fast as possible. This routine should "incrementally" update the score.

Definition at line 131 of file rankstatic.c.

◆ begin()

void * begin ( struct zebra_register * reg,
void * class_handle,
RSET rset,
NMEM nmem,
TERMID * terms,
int numterms )
static

begin: Prepares beginning of "real" ranking. Called once for each result set. The returned handle is a "set handle" and will be used in each of the handlers below.

Definition at line 74 of file rankstatic.c.

References log_level, ord_list::next, rank_set_info::nmem, rank_set_info::no_rank_entries, rset_term::ol, ord_list::ord, zebraExplain_lookup_ord(), and zebra_register::zei.

◆ calc()

int calc ( void * set_handle,
zint sysno,
zint staticrank,
int * stop_flag )
static

Definition at line 141 of file rankstatic.c.

References CAST_ZINT_TO_INT, and rank_set_info::no_rank_entries.

◆ create()

void * create ( ZebraHandle zh)
static

Definition at line 47 of file rankstatic.c.

References log_initialized, and log_level.

◆ destroy()

void destroy ( struct zebra_register * reg,
void * class_handle )
static

Definition at line 63 of file rankstatic.c.

References log_level.

◆ end()

void end ( struct zebra_register * reg,
void * set_handle )
static

Definition at line 120 of file rankstatic.c.

References log_level.

Variable Documentation

◆ log_initialized

int log_initialized = 0
static

Definition at line 37 of file rankstatic.c.

◆ log_level

int log_level = 0
static

Definition at line 36 of file rankstatic.c.

◆ rank_control

struct rank_control rank_control
static
Initial value:
= {
"rank-static",
end,
add,
}
static void * create(ZebraHandle zh)
Definition rank1.c:74
static void * begin(struct zebra_register *reg, void *class_handle, RSET rset, NMEM nmem, TERMID *terms, int numterms)
Definition rank1.c:107
void(* end)(struct zebra_register *reg, void *set_handle)
Definition rank.h:39
int(* calc)(void *set_handle, zint sysno, zint staticrank, int *stop_flag)
Definition rank.h:40
void(* destroy)(struct zebra_register *reg, void *class_handle)
Definition rank.h:30
void(* add)(void *set_handle, int seqno, TERMID term)
Definition rank.h:42

Definition at line 175 of file rankstatic.c.

◆ rank_static_class

struct rank_control* rank_static_class = &rank_control

Definition at line 185 of file rankstatic.c.

Referenced by zebra_register_open().