open-source-search-engine/Msg37.h

68 lines
1.6 KiB
C
Raw Normal View History

2013-08-03 00:12:24 +04:00
// Matt Wells, copyright Jul 2001
// . get the number of records (termId/docId/score tuple) in an IndexList(s)
// for a given termId(s)
// . if it's truncated then interpolate based on score
// . used for query routing
// . used for query term weighting (IDF)
// . used to set m_termFreq for each termId in query in the Query class
#ifndef _MSG37_H_
#define _MSG37_H_
#include "Msg36.h"
#include "Query.h" // MAX_QUERY_TERMS
#define MAX_MSG36_OUT 20
class Msg37 {
public:
// . returns false if blocked, true otherwise
// . sets errno on error
// . "termIds/termFreqs" should NOT be on the stack in case we block
bool getTermFreqs ( collnum_t collnum ,
2014-11-11 01:45:11 +03:00
int32_t maxAge ,
2014-10-30 22:36:39 +03:00
int64_t *termIds ,
2014-11-11 01:45:11 +03:00
int32_t numTermIds ,
2014-10-30 22:36:39 +03:00
int64_t *termFreqs ,
2013-08-03 00:12:24 +04:00
void *state ,
void (* callback)(void *state ) ,
2014-11-11 01:45:11 +03:00
int32_t niceness , // = MAX_NICENESS
2013-08-03 00:12:24 +04:00
bool exactCount );
bool launchRequests ( ) ;
// leave public so C wrapper can call
bool gotTermFreq ( Msg36 *msg36 ) ;
// we can get up to MAX_QUERY_TERMS term frequencies at the same time
Msg36 m_msg36 [ MAX_MSG36_OUT ]; // [ MAX_QUERY_TERMS ];
char m_inUse [ MAX_MSG36_OUT ];
2014-11-11 01:45:11 +03:00
int32_t m_i;
2013-08-03 00:12:24 +04:00
// . ptr to "termFreqs" passed in by getTermFreqs[]
// . we remember it so we can set them
2014-10-30 22:36:39 +03:00
int64_t *m_termFreqs;
2014-11-11 01:45:11 +03:00
int32_t m_numTerms;
2013-08-03 00:12:24 +04:00
2014-11-11 01:45:11 +03:00
int32_t m_numReplies ;
int32_t m_numRequests ;
int32_t m_errno;
2013-08-03 00:12:24 +04:00
void *m_state ;
void ( * m_callback ) ( void *state );
2014-11-11 01:45:11 +03:00
int32_t m_niceness;
2013-08-03 00:12:24 +04:00
bool m_exactCount;
collnum_t m_collnum;
2013-08-03 00:12:24 +04:00
2014-11-11 01:45:11 +03:00
int32_t m_maxAge;
2014-10-30 22:36:39 +03:00
int64_t *m_termIds ;
2013-08-03 00:12:24 +04:00
};
#endif