Author: rooneg
Date: Sat Mar 19 07:18:11 2005
New Revision: 158244
URL: http://svn.apache.org/viewcvs?view=rev&rev=158244
Log:
Add some accessor functions to the doc iter interface that are needed
to implement scoring correctly.
* include/lcn_index.h
(lcn_doc_iter_max_docs,
lcn_doc_iter_term_freq): new prototypes.
* src/index/index.c
(lcn_doc_iter_max_docs,
lcn_doc_iter_term_freq): implement.
Modified:
incubator/lucene4c/trunk/include/lcn_index.h
incubator/lucene4c/trunk/src/index/index.c
Modified: incubator/lucene4c/trunk/include/lcn_index.h
URL:
http://svn.apache.org/viewcvs/incubator/lucene4c/trunk/include/lcn_index.h?view=diff&r1=158243&r2=158244
==============================================================================
--- incubator/lucene4c/trunk/include/lcn_index.h (original)
+++ incubator/lucene4c/trunk/include/lcn_index.h Sat Mar 19 07:18:11 2005
@@ -53,8 +53,14 @@
/** Return the current document number from @a itr. */
apr_uint32_t lcn_doc_iter_doc (lcn_doc_iter_t *itr);
+/** Return the maximum document number that can be returned from @a itr. */
+apr_uint32_t lcn_doc_iter_max_docs (lcn_doc_iter_t *itr);
+
/** Return the current document's frequency from @a itr. */
apr_uint32_t lcn_doc_iter_freq (lcn_doc_iter_t *itr);
+
+/** Return the total number of hits for the term in the current segment. */
+apr_uint32_t lcn_doc_iter_term_freq (lcn_doc_iter_t *itr);
/** Move @a itr to the next document.
*
Modified: incubator/lucene4c/trunk/src/index/index.c
URL:
http://svn.apache.org/viewcvs/incubator/lucene4c/trunk/src/index/index.c?view=diff&r1=158243&r2=158244
==============================================================================
--- incubator/lucene4c/trunk/src/index/index.c (original)
+++ incubator/lucene4c/trunk/src/index/index.c Sat Mar 19 07:18:11 2005
@@ -78,6 +78,18 @@
}
apr_uint32_t
+lcn_doc_iter_max_docs (lcn_doc_iter_t *itr)
+{
+ return lcn_index_max_docs (itr->index);
+}
+
+apr_uint32_t
+lcn_doc_iter_term_freq (lcn_doc_iter_t *itr)
+{
+ return itr->count_in_seg;
+}
+
+apr_uint32_t
lcn_doc_iter_freq (lcn_doc_iter_t *itr)
{
return itr->seg_freqnums[itr->idx_in_seg];