Class TermItem

    • Constructor Detail

      • TermItem

        public TermItem()
      • TermItem

        public TermItem​(java.lang.String indexName)
      • TermItem

        public TermItem​(java.lang.String indexName,
                        boolean isFromQuery)
      • TermItem

        protected TermItem​(java.lang.String indexName,
                           boolean isFromQuery,
                           Substring origin)
    • Method Detail

      • encode

        public final int encode​(java.nio.ByteBuffer buffer)
        Specified by:
        encode in class Item
      • appendBodyString

        protected final void appendBodyString​(java.lang.StringBuilder buffer)
        Appends the index prefix if necessary and delegates to the subclass
        Specified by:
        appendBodyString in class Item
      • setValue

        public abstract void setValue​(java.lang.String value)
        Sets the value of this item from a string.
        Throws:
        java.lang.UnsupportedOperationException - if this is not supported on this kind of item
      • getRawWord

        public abstract java.lang.String getRawWord()
        Returns the raw form of the text leading to this term, exactly as received, including original casing
        Specified by:
        getRawWord in interface BlockItem
      • getOrigin

        public Substring getOrigin()
        Returns the substring which is the raw form of the text leading to this token. This substring also contains the superstring this substring was a part of, e.g the whole query string. If this did not originate directly from a user string, this is null.
        Specified by:
        getOrigin in interface BlockItem
      • isFromQuery

        public boolean isFromQuery()
        Whether this term is from the query or has been added by a searcher. Only terms from the user should be modified by query rewriters which attempts to improve the precision or recall of the user's query.
        Specified by:
        isFromQuery in interface BlockItem
      • isWords

        public abstract boolean isWords()
        Description copied from interface: BlockItem
        Does this item represent "usual words"?
        Specified by:
        isWords in interface BlockItem
      • setOrigin

        public void setOrigin​(Substring origin)
        Sets the origin of this
      • getTermCount

        public int getTermCount()
        Specified by:
        getTermCount in class Item
      • isNormalizable

        public boolean isNormalizable()
        This refers to whether accent removal is a meaningful and possible operation for this word. It should be named "isTransformable" or similar, but for historical reasons that is not the case. This method has nothing to do with Unicode normalization.
        Returns:
        true if accent removal can/should be performed
      • setNormalizable

        public void setNormalizable​(boolean normalizable)
        This refers to whether accent removal is a meaningful and possible operation for this word. It should be named "isTransformable" or similar, but for historical reasons that is not the case. This method has nothing to do with Unicode normalization.
        Parameters:
        normalizable - set to true if accent removal can/should be performed
      • getSegmentingRule

        public SegmentingRule getSegmentingRule()
        Description copied from interface: BlockItem
        If the block has to be resegmented, what operator should be chosen if it is necessary to change operator?
        Specified by:
        getSegmentingRule in interface BlockItem
      • setSegmentingRule

        public void setSegmentingRule​(SegmentingRule segmentingRule)