#define MARCMAP_H
struct marcmap
-{
+{
char *field;
char subfield;
char *pz;
struct record_metadata {
union data_types data;
// next item of this name
- struct record_metadata *next;
+ struct record_metadata *next;
struct record_metadata_attr *attributes;
};
-union data_types * data_types_assign(NMEM nmem,
- union data_types ** data1,
+union data_types * data_types_assign(NMEM nmem,
+ union data_types ** data1,
union data_types data2);
struct record_metadata **metadata;
// Array mirrors list of sortkey fields in config
union data_types **sortkeys;
- // Next in cluster of merged records
- struct record *next;
+ // Next in cluster of merged records
+ struct record *next;
// client result set position;
int position;
// checksum
struct record_cluster
{
// Array mirrors list of metadata fields in config
- struct record_metadata **metadata;
+ struct record_metadata **metadata;
union data_types **sortkeys;
char *merge_key;
int relevance_score;
for (i = 0; i < numwords; i++)
{
const char *norm_str;
-
+
ccl_field = nmem_strdup_null(res->nmem, n->u.t.qual);
pp2_charset_token_first(res->prt, words[i], 0);
res->vec_len = 1;
res->rank_cluster = rank_cluster;
res->prt = pp2_charset_token_create(pft, "relevance");
-
+
pull_terms(res, query);
res->doc_frequency_vec = nmem_malloc(nmem, res->vec_len * sizeof(int));
for (i = 0; i < res->vec_len; i++)
- res->doc_frequency_vec[i] = 0;
+ res->doc_frequency_vec[i] = 0;
return res;
}
r->vec_len * sizeof(*rec->term_frequency_vec));
for (i = 0; i < r->vec_len; i++)
rec->term_frequency_vec[i] = 0;
-
+
// term frequency divided by length of field [1,...]
rec->term_frequency_vecf =
nmem_malloc(r->nmem,
r->vec_len * sizeof(*rec->term_frequency_vecf));
for (i = 0; i < r->vec_len; i++)
rec->term_frequency_vecf[i] = 0.0;
-
+
// for relevance_countwords (so we don't have to xmalloc/xfree)
rec->term_frequency_vec_tmp =
nmem_malloc(r->nmem,
for (record = rec->records; record; record = record->next)
cluster_size++;
-
+
relevance /= cluster_size;
}
rec->relevance_score = relevance;
/** \brief select thread handler type */
typedef struct sel_thread *sel_thread_t;
-/** \brief creates select thread
+/** \brief creates select thread
\param work_handler handler that does work in worker thread
\param work_destroy optional destroy handler for work (0 = no handler)
\param read_fd pointer to readable socket upon completion
void (*work_destroy)(void *work_data),
int *read_fd, int no_of_threads);
-/** \brief destorys select thread
+/** \brief destorys select thread
\param p select thread handler
*/
void sel_thread_destroy(sel_thread_t p);
*/
void sel_thread_add(sel_thread_t p, void *data);
-/** \brief gets result of work
+/** \brief gets result of work
\param p select thread handler
\returns data for work (which work_handler has been working on)
*/