Class ScoreFunctionBuilder<FB extends ScoreFunctionBuilder<FB>>

    • Constructor Detail

      • ScoreFunctionBuilder

        public ScoreFunctionBuilder()
        Standard empty constructor.
    • Method Detail

      • getName

        public abstract String getName()
        The name of this score function.
      • setWeight

        public final FB setWeight​(float weight)
        Set the weight applied to the function before combining.
      • getWeight

        public final Float getWeight()
        The weight applied to the function before combining.
      • equals

        public final boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • doEquals

        protected abstract boolean doEquals​(FB functionBuilder)
        Check that two instances of the same subclass of ScoreFunctionBuilder are equal. Implementers don't need to check any fields in ScoreFunctionBuilder, just fields that they define.
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • doHashCode

        protected abstract int doHashCode()
        Hashcode for fields defined in this subclass of ScoreFunctionBuilder. Implementers should ignore fields defined in ScoreFunctionBuilder because they will already be in the hashCode.
      • doToFunction

        protected abstract ScoreFunction doToFunction​(QueryShardContext context)
                                               throws IOException
        Build the Lucene ScoreFunction for this builder. Implementers should ignore things defined in ScoreFunctionBuilder like weight as they will be handled by the function that calls this one.
        Throws:
        IOException