Class Index


  • public class Index
    extends java.lang.Object
    Information about configured settings of a field or field collection (an actual index or not) in a search definition. There are two types of settings:
    • Typed commands are checked using a particular is/get method
    • Untyped commands are checked using hasCommand and commandIterator
    addCommand sets both types.
    Author:
    Steinar Knutsen, bratseth
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Index.Attribute  
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static Index nullIndex
      The null index - don't use this for name lookups
    • Constructor Summary

      Constructors 
      Constructor Description
      Index​(java.lang.String name)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addAlias​(java.lang.String alias)  
      Index addCommand​(java.lang.String commandString)
      Adds a type or untyped command string to this
      java.util.List<java.lang.String> aliases()
      Returns an unmodifiable list of the aliases of this index (not including the index proper name)
      java.util.List<java.lang.String> allCommands()
      Returns all the literal command strings given as arguments to addCommand in this instance
      java.util.Iterator<java.lang.String> commandIterator()
      Returns an iterator of all the untyped commands of this
      boolean getDynamicSummary()  
      java.lang.String getExactTerminator()
      Returns the string terminating an exact sequence in this index, or null to use the default (space)
      int getGramSize()
      Returns the gram size.
      boolean getHighlightSummary()  
      boolean getLiteralBoost()  
      java.lang.String getName()
      Returns the canonical name of this index, unless it is the null index, which doesn't have a canonical name
      boolean getNormalize()
      Returns true if the content of this index is normalized
      long getPredicateLowerBound()  
      long getPredicateUpperBound()  
      com.yahoo.language.process.StemMode getStemMode()  
      boolean hasCommand​(java.lang.String commandString)
      Checks whether this has the given (exact) untyped command string
      boolean hasPlainTokens()  
      boolean isAttribute()  
      boolean isDefaultPosition()  
      boolean isExact()
      Returns whether this is an exact index, which should match tokens containing any characters
      boolean isFastSearch()
      Returns true if this is an attribute with fastsearch turned on
      boolean isHostIndex()  
      boolean isLowercase()
      Whether terms in this field are lower cased when indexing.
      boolean isMultivalue()
      Returns true if this is a multivalue field
      boolean isNGram()
      Returns true if this is an ngram index (default: false)
      boolean isNull()
      Returns true if this is the null index
      boolean isNumerical()  
      boolean isUriIndex()  
      void setAttribute​(boolean isAttribute)  
      void setDefaultPosition​(boolean v)  
      void setDynamicSummary​(boolean dynamicSummary)  
      void setExact​(boolean exact, java.lang.String terminator)
      Set whether this index should match any kind of characters
      void setFastSearch​(boolean fastSearch)  
      void setHighlightSummary​(boolean highlightSummary)  
      void setHostIndex​(boolean hostIndex)  
      void setLiteralBoost​(boolean literalBoost)  
      void setLowercase​(boolean lowercase)
      Whether terms in this field are lower cased when indexing.
      void setMultivalue​(boolean multivalue)  
      void setNGram​(boolean nGram, int gramSize)  
      void setNormalize​(boolean normalize)  
      void setNumerical​(boolean numerical)  
      void setPlainTokens​(boolean plainTokens)  
      void setStemMode​(com.yahoo.language.process.StemMode stemMode)  
      void setStemMode​(java.lang.String name)  
      void setUriIndex​(boolean uriIndex)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • nullIndex

        public static final Index nullIndex
        The null index - don't use this for name lookups
    • Constructor Detail

      • Index

        public Index​(java.lang.String name)
    • Method Detail

      • addAlias

        public void addAlias​(java.lang.String alias)
      • aliases

        public java.util.List<java.lang.String> aliases()
        Returns an unmodifiable list of the aliases of this index (not including the index proper name)
      • getName

        public java.lang.String getName()
        Returns the canonical name of this index, unless it is the null index, which doesn't have a canonical name
      • isUriIndex

        public boolean isUriIndex()
      • isDefaultPosition

        public boolean isDefaultPosition()
      • setDefaultPosition

        public void setDefaultPosition​(boolean v)
      • setUriIndex

        public void setUriIndex​(boolean uriIndex)
      • isHostIndex

        public boolean isHostIndex()
      • setHostIndex

        public void setHostIndex​(boolean hostIndex)
      • getStemMode

        public com.yahoo.language.process.StemMode getStemMode()
      • setStemMode

        public void setStemMode​(com.yahoo.language.process.StemMode stemMode)
      • setStemMode

        public void setStemMode​(java.lang.String name)
      • addCommand

        public Index addCommand​(java.lang.String commandString)
        Adds a type or untyped command string to this
      • setLowercase

        public void setLowercase​(boolean lowercase)
        Whether terms in this field are lower cased when indexing.
        Parameters:
        lowercase - true if terms are lowercased
      • isLowercase

        public boolean isLowercase()
        Whether terms in this field are lower cased when indexing.
        Returns:
        true if terms are lowercased
      • commandIterator

        public java.util.Iterator<java.lang.String> commandIterator()
        Returns an iterator of all the untyped commands of this
      • hasCommand

        public boolean hasCommand​(java.lang.String commandString)
        Checks whether this has the given (exact) untyped command string
      • setExact

        public void setExact​(boolean exact,
                             java.lang.String terminator)
        Set whether this index should match any kind of characters
        Parameters:
        exact - true to make this index match any kind of characters, not just word and digit ones
        terminator - the terminator of an exact sequence (one or more characters), or null to use the default (space)
      • isExact

        public boolean isExact()
        Returns whether this is an exact index, which should match tokens containing any characters
      • getExactTerminator

        public java.lang.String getExactTerminator()
        Returns the string terminating an exact sequence in this index, or null to use the default (space)
      • isNGram

        public boolean isNGram()
        Returns true if this is an ngram index (default: false)
      • getGramSize

        public int getGramSize()
        Returns the gram size. Only used if isNGram is true (default: 2)
      • setNGram

        public void setNGram​(boolean nGram,
                             int gramSize)
      • setDynamicSummary

        public void setDynamicSummary​(boolean dynamicSummary)
      • getDynamicSummary

        public boolean getDynamicSummary()
      • setHighlightSummary

        public void setHighlightSummary​(boolean highlightSummary)
      • getHighlightSummary

        public boolean getHighlightSummary()
      • isNull

        public boolean isNull()
        Returns true if this is the null index
      • isAttribute

        public boolean isAttribute()
      • setAttribute

        public void setAttribute​(boolean isAttribute)
      • hasPlainTokens

        public boolean hasPlainTokens()
      • setPlainTokens

        public void setPlainTokens​(boolean plainTokens)
      • setMultivalue

        public void setMultivalue​(boolean multivalue)
      • isMultivalue

        public boolean isMultivalue()
        Returns true if this is a multivalue field
      • setFastSearch

        public void setFastSearch​(boolean fastSearch)
      • isFastSearch

        public boolean isFastSearch()
        Returns true if this is an attribute with fastsearch turned on
      • setNormalize

        public void setNormalize​(boolean normalize)
      • getNormalize

        public boolean getNormalize()
        Returns true if the content of this index is normalized
      • getLiteralBoost

        public boolean getLiteralBoost()
      • setLiteralBoost

        public void setLiteralBoost​(boolean literalBoost)
      • setNumerical

        public void setNumerical​(boolean numerical)
      • isNumerical

        public boolean isNumerical()
      • getPredicateUpperBound

        public long getPredicateUpperBound()
      • getPredicateLowerBound

        public long getPredicateLowerBound()
      • allCommands

        public java.util.List<java.lang.String> allCommands()
        Returns all the literal command strings given as arguments to addCommand in this instance
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object