/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
parcel Lucy;
/** Read postings data.
*
* PostingListReaders produce [](cfish:PostingList)
* objects which convey document matching information.
*/
public class Lucy::Index::PostingListReader nickname PListReader
inherits Lucy::Index::DataReader {
inert PostingListReader*
init(PostingListReader *self, Schema *schema = NULL,
Folder *folder = NULL, Snapshot *snapshot = NULL,
Vector *segments = NULL, int32_t seg_tick = -1);
/** Returns a PostingList, or [](cfish:@null) if either `field` is
* [](cfish:@null) or `field` is not present in any documents.
*
* @param field A field name.
* @param term If supplied, the PostingList will be pre-located to this
* term using [](cfish:PostingList.Seek).
*/
public abstract incremented nullable PostingList*
Posting_List(PostingListReader *self, String *field = NULL,
Obj *term = NULL);
abstract LexiconReader*
Get_Lex_Reader(PostingListReader *self);
/** Returns [](cfish:@null) since PostingLists may only be iterated at the
* segment level.
*/
public incremented nullable PostingListReader*
Aggregator(PostingListReader *self, Vector *readers, I32Array *offsets);
}
class Lucy::Index::DefaultPostingListReader nickname DefPListReader
inherits Lucy::Index::PostingListReader {
LexiconReader *lex_reader;
inert incremented DefaultPostingListReader*
new(Schema *schema, Folder *folder, Snapshot *snapshot, Vector *segments,
int32_t seg_tick, LexiconReader *lex_reader);
inert DefaultPostingListReader*
init(DefaultPostingListReader *self, Schema *schema, Folder *folder,
Snapshot *snapshot, Vector *segments, int32_t seg_tick,
LexiconReader *lex_reader);
public incremented nullable SegPostingList*
Posting_List(DefaultPostingListReader *self, String *field = NULL,
Obj *term = NULL);
LexiconReader*
Get_Lex_Reader(DefaultPostingListReader *self);
void
Close(DefaultPostingListReader *self);
public void
Destroy(DefaultPostingListReader *self);
}