Class Scorer.ScorerVisitor<P extends Query,​C extends Query,​S extends Scorer>

  • Enclosing class:
    Scorer

    public abstract static class Scorer.ScorerVisitor<P extends Query,​C extends Query,​S extends Scorer>
    extends Object
    A callback to gather information from a scorer and its sub-scorers. Each the top-level scorer as well as each of its sub-scorers are passed to either one of the visit methods depending on their boolean relationship in the query.
    WARNING: This API is experimental and might change in incompatible ways in the next release.
    • Constructor Detail

      • ScorerVisitor

        public ScorerVisitor()
    • Method Detail

      • visitOptional

        public void visitOptional​(P parent,
                                  C child,
                                  S scorer)
        Invoked for all optional scorer
        Parameters:
        parent - the parent query of the child query or null if the child is a top-level query
        child - the query of the currently visited scorer
        scorer - the current scorer
      • visitRequired

        public void visitRequired​(P parent,
                                  C child,
                                  S scorer)
        Invoked for all required scorer
        Parameters:
        parent - the parent query of the child query or null if the child is a top-level query
        child - the query of the currently visited scorer
        scorer - the current scorer
      • visitProhibited

        public void visitProhibited​(P parent,
                                    C child,
                                    S scorer)
        Invoked for all prohibited scorer
        Parameters:
        parent - the parent query of the child query or null if the child is a top-level query
        child - the query of the currently visited scorer
        scorer - the current scorer