diff options
Diffstat (limited to 'predicate-search/src/main/java/com/yahoo/search/predicate/index/PostingList.java')
-rw-r--r-- | predicate-search/src/main/java/com/yahoo/search/predicate/index/PostingList.java | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/predicate-search/src/main/java/com/yahoo/search/predicate/index/PostingList.java b/predicate-search/src/main/java/com/yahoo/search/predicate/index/PostingList.java new file mode 100644 index 00000000000..f0f310f1962 --- /dev/null +++ b/predicate-search/src/main/java/com/yahoo/search/predicate/index/PostingList.java @@ -0,0 +1,53 @@ +// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.search.predicate.index; + +/** + * Interface for posting lists to be used by the algorithm implemented in PredicateSearch. + * + * @author <a href="mailto:magnarn@yahoo-inc.com">Magnar Nedland</a> + */ +public interface PostingList { + /** + * Moves the posting list past the supplied document id. + * @param docId Document id to move past. + * @return True if a new document was found + */ + boolean nextDocument(int docId); + + /** + * Prepare iterator for interval iteration. + * @return True if the iterator has any intervals. + */ + boolean prepareIntervals(); + + /** + * Fetches the next interval for the current document. + * @return True if there was a next interval + */ + boolean nextInterval(); + + /** + * @return The doc id for the current document + */ + int getDocId(); + + /** + * @return The number of documents (actual count or estimate) + */ + int size(); + + /** + * @return The current interval for the current document + */ + int getInterval(); + + /** + * @return the subquery bitmap for this posting list. + */ + long getSubquery(); + + /** + * @return The document ids + */ + int[] getDocIds(); +} |