Main Page | Data Structures | Directories | File List | Data Fields | Globals

lcn_segment.h

Go to the documentation of this file.
00001 /* Copyright 2005 The Apache Software Foundation or its licensors, as
00002  * applicable.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 /**
00018  * @file lcn_segment.h
00019  * @brief Routines for manipulating a segment of a lucene index
00020  */
00021 
00022 #ifndef _LCN_SEGMENT_H
00023 #define _LCN_SEGMENT_H
00024 
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif /* __cplusplus */
00028 
00029 #include "lcn_types.h"
00030 #include "lcn_directory.h"
00031 #include "lcn_term.h"
00032 #include "lcn_document.h"
00033 
00034 /** An opaque structure representing a segment of a lucene index. */
00035 typedef struct lcn_segment_t lcn_segment_t;
00036 
00037 /** Open the segment @a segname, of size @a size containing documents
00038  * starting at @a offset, within directory @a d and return it in @a segment,
00039  * allocated from @a pool.
00040  */
00041 lcn_error_t *
00042 lcn_segment_open (lcn_segment_t **segment,
00043                   const lcn_char_t *segname,
00044                   apr_uint32_t size,
00045                   apr_uint32_t offset,
00046                   const lcn_directory_t *d,
00047                   apr_pool_t *pool);
00048 
00049 /** Return the name of @a segment. */
00050 const lcn_char_t *
00051 lcn_segment_name (const lcn_segment_t *segment);
00052 
00053 /** Return the size (in documents) of @a segment. */
00054 apr_uint32_t
00055 lcn_segment_size (const lcn_segment_t *segment);
00056 
00057 /** Return the directory @a segment is in. */
00058 const lcn_directory_t *
00059 lcn_segment_directory (const lcn_segment_t *segment);
00060 
00061 /** Return the document frquency @a doc_freq, document numbers @a docs, and
00062  * the frequencies @a freqs of the documents within @a segment that contain
00063  * @a term, using @a pool for allocation.
00064  */
00065 lcn_error_t *
00066 lcn_segment_term_docs (apr_uint32_t *doc_freq,
00067                        apr_uint32_t **docs,
00068                        apr_uint32_t **freqs,
00069                        lcn_segment_t *segment,
00070                        const lcn_term_t *term,
00071                        apr_pool_t *pool);
00072 
00073 /** Return the document @a doc from @a segment that has the number @a docnum,
00074  * allocated within @a pool.
00075  */
00076 lcn_error_t *
00077 lcn_segment_get_document (lcn_document_t **doc,
00078                           lcn_segment_t *segment,
00079                           apr_uint32_t docnum,
00080                           apr_pool_t *pool);
00081 
00082 #ifdef __cplusplus
00083 }
00084 #endif /* __cplusplus */
00085 
00086 #endif

Generated on Sat Mar 26 08:12:11 2005 for Lucene4c by  doxygen 1.4.0