IDZEBRA  2.2.7
Data Structures | Functions | Variables
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_controlrank_static_class = &rank_control
 

Function Documentation

◆ add()

static 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()

static 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()

static 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()

static void* create ( ZebraHandle  zh)
static

Definition at line 47 of file rankstatic.c.

References log_initialized, and log_level.

◆ destroy()

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

Definition at line 63 of file rankstatic.c.

References log_level.

◆ end()

static 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.

Referenced by create().

◆ log_level

int log_level = 0
static

Definition at line 36 of file rankstatic.c.

Referenced by begin(), create(), destroy(), and end().

◆ rank_control

struct rank_control rank_control
static
Initial value:
= {
"rank-static",
end,
add,
}
static void * begin(struct zebra_register *reg, void *class_handle, RSET rset, NMEM nmem, TERMID *terms, int numterms)
Definition: rankstatic.c:74
static void end(struct zebra_register *reg, void *set_handle)
Definition: rankstatic.c:120
static void * create(ZebraHandle zh)
Definition: rankstatic.c:47
static void destroy(struct zebra_register *reg, void *class_handle)
Definition: rankstatic.c:63
static int calc(void *set_handle, zint sysno, zint staticrank, int *stop_flag)
Definition: rankstatic.c:141
static void add(void *set_handle, int seqno, TERMID term)
Definition: rankstatic.c:131

Definition at line 141 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().