Class NRTSuggesterBuilder


  • final class NRTSuggesterBuilder
    extends java.lang.Object
    Builder for NRTSuggester
    • Constructor Detail

      • NRTSuggesterBuilder

        public NRTSuggesterBuilder()
        Create a builder for NRTSuggester
    • Method Detail

      • startTerm

        public void startTerm​(BytesRef analyzed)
        Initializes an FST input term to add entries against
      • addEntry

        public void addEntry​(int docID,
                             BytesRef surfaceForm,
                             long weight)
                      throws java.io.IOException
        Adds an entry for the latest input term, should be called after startTerm(org.apache.lucene.util.BytesRef) on the desired input
        Throws:
        java.io.IOException
      • finishTerm

        public void finishTerm()
                        throws java.io.IOException
        Writes all the entries for the FST input term
        Throws:
        java.io.IOException
      • maxNumArcsForDedupByte

        private static int maxNumArcsForDedupByte​(int currentNumDedupBytes)
        Num arcs for nth dedup byte: if n <= 5: 1 + (2 * n) else: (1 + (2 * n)) * n

        TODO: is there a better way to make the fst built to be more TopNSearcher friendly?