Package com.yahoo.search.predicate
Class PredicateIndex
- java.lang.Object
-
- com.yahoo.search.predicate.PredicateIndex
-
@Beta public class PredicateIndex extends java.lang.Object
An index ofPredicate
objects.Use a
PredicateQuery
to find the ids of documents that have matching Predicates. Create an instance ofPredicateIndex
using thePredicateIndexBuilder
.To build a
PredicateQuery
you add features and rangeFeatures with a 64-bit bitmap specifying which subqueries they appear in.To perform a search, create a
PredicateIndex.Searcher
and call itsPredicateIndex.Searcher.search(PredicateQuery)
method, which returns a stream ofHit
objects, each of which contains a document id and a 64-bit bitmap specifying which subqueries the hit is for.Note that the
PredicateIndex
is thread-safe, but aPredicateIndex.Searcher
is not. Each thread must use its own searcher.- Author:
- Magnar Nedland, bjorncs
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
PredicateIndex.Searcher
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PredicateIndex
fromInputStream(java.io.DataInputStream in)
void
rebuildPostingListCache()
PredicateIndex.Searcher
searcher()
Create a new searcher.void
writeToOutputStream(java.io.DataOutputStream out)
-
-
-
Method Detail
-
rebuildPostingListCache
public void rebuildPostingListCache()
-
searcher
public PredicateIndex.Searcher searcher()
Create a new searcher.
-
writeToOutputStream
public void writeToOutputStream(java.io.DataOutputStream out) throws java.io.IOException
- Throws:
java.io.IOException
-
fromInputStream
public static PredicateIndex fromInputStream(java.io.DataInputStream in) throws java.io.IOException
- Throws:
java.io.IOException
-
-