Groonga
Loading...
Searching...
No Matches
scorer.h
Go to the documentation of this file.
1/*
2 Copyright(C) 2015-2016 Brazil
3 Copyright(C) 2020-2022 Sutou Kouhei <kou@clear-code.com>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18*/
19
20#pragma once
21
22#include <groonga/plugin.h>
23
24#ifdef __cplusplus
25extern "C" {
26#endif /* __cplusplus */
27
28typedef struct _grn_scorer_matched_record grn_scorer_matched_record;
29
45GRN_API uint32_t
48GRN_API uint64_t
51GRN_API uint32_t
54GRN_API uint64_t
57GRN_API uint32_t
60GRN_API int
66 unsigned int i);
67GRN_API unsigned int
70
71
72
73typedef double grn_scorer_score_func(grn_ctx *ctx,
75
76/*
77 grn_scorer_register() registers a plugin to the database which is
78 associated with `ctx'. `scorer_name_ptr' and `scorer_name_length' specify the
79 plugin name. Alphabetic letters ('A'-'Z' and 'a'-'z'), digits ('0'-'9') and
80 an underscore ('_') are capable characters.
81
82 `score' is called for scoring matched records one by one.
83
84 grn_scorer_register() returns GRN_SUCCESS on success, an error
85 code on failure.
86 */
88 const char *scorer_name_ptr,
89 int scorer_name_length,
91
92#ifdef __cplusplus
93} /* extern "C" */
94#endif /* __cplusplus */
grn_rc
Definition groonga.h:61
uint32_t grn_id
Definition groonga.h:44
#define GRN_API
Definition groonga.h:39
#define GRN_PLUGIN_EXPORT
Definition plugin.h:50
GRN_API grn_obj * grn_scorer_matched_record_get_term_weights(grn_ctx *ctx, grn_scorer_matched_record *record)
GRN_PLUGIN_EXPORT grn_rc grn_scorer_register(grn_ctx *ctx, const char *scorer_name_ptr, int scorer_name_length, grn_scorer_score_func *score)
GRN_API uint32_t grn_scorer_matched_record_get_n_occurrences(grn_ctx *ctx, grn_scorer_matched_record *record)
GRN_API uint64_t grn_scorer_matched_record_get_n_documents(grn_ctx *ctx, grn_scorer_matched_record *record)
GRN_API grn_obj * grn_scorer_matched_record_get_table(grn_ctx *ctx, grn_scorer_matched_record *record)
GRN_API uint32_t grn_scorer_matched_record_get_total_term_weights(grn_ctx *ctx, grn_scorer_matched_record *record)
GRN_API unsigned int grn_scorer_matched_record_get_n_args(grn_ctx *ctx, grn_scorer_matched_record *record)
GRN_API uint64_t grn_scorer_matched_record_get_n_candidates(grn_ctx *ctx, grn_scorer_matched_record *record)
GRN_API grn_obj * grn_scorer_matched_record_get_lexicon(grn_ctx *ctx, grn_scorer_matched_record *record)
GRN_API grn_obj * grn_scorer_matched_record_get_arg(grn_ctx *ctx, grn_scorer_matched_record *record, unsigned int i)
GRN_API uint32_t grn_scorer_matched_record_get_n_tokens(grn_ctx *ctx, grn_scorer_matched_record *record)
struct _grn_scorer_matched_record grn_scorer_matched_record
Definition scorer.h:28
double grn_scorer_score_func(grn_ctx *ctx, grn_scorer_matched_record *record)
Definition scorer.h:73
GRN_API int grn_scorer_matched_record_get_weight(grn_ctx *ctx, grn_scorer_matched_record *record)
GRN_API grn_id grn_scorer_matched_record_get_id(grn_ctx *ctx, grn_scorer_matched_record *record)
GRN_API grn_obj * grn_scorer_matched_record_get_terms(grn_ctx *ctx, grn_scorer_matched_record *record)
Definition groonga.h:351
Definition groonga.h:919