public abstract class TermItem extends SimpleIndexedItem implements BlockItem
A query term, that is, not only a term in the query language (an item), but also a term to be found in (or excluded from) the search index.
Optionally, a TermItem may also specify the name of an index backend to search.
Item.ItemCreator, Item.ItemType
connectedBacklink, connectedItem, connectivity, DEFAULT_WEIGHT, explicitSignificance, significance, uniqueID
Modifier | Constructor and Description |
---|---|
|
TermItem() |
|
TermItem(String indexName) |
|
TermItem(String indexName,
boolean isFromQuery) |
protected |
TermItem(String indexName,
boolean isFromQuery,
Substring origin) |
Modifier and Type | Method and Description |
---|---|
protected void |
appendBodyString(StringBuilder buffer)
Appends the index prefix if necessary and delegates to the subclass
|
void |
disclose(Discloser discloser) |
int |
encode(ByteBuffer buffer) |
Substring |
getOrigin()
Returns the substring which is the raw form of the text leading to this token.
|
abstract String |
getRawWord()
Returns the raw form of the text leading to this term, exactly as received, including original casing
|
SegmentingRule |
getSegmentingRule()
If the block has to be resegmented, what operator should be chosen if it
is necessary to change operator?
|
int |
getTermCount() |
boolean |
isFromQuery()
Whether this term is from the query or has been added by a searcher.
|
boolean |
isNormalizable()
This refers to whether accent removal is a meaningful and possible
operation for this word.
|
abstract boolean |
isWords()
Does this item represent "usual words"?
|
void |
setNormalizable(boolean normalizable)
This refers to whether accent removal is a meaningful and possible
operation for this word.
|
void |
setOrigin(Substring origin)
Sets the origin of this
|
void |
setSegmentingRule(SegmentingRule segmentingRule) |
abstract void |
setValue(String value)
Sets the value of this item from a string.
|
appendIndexString, encodeThis, equals, getIndexedString, getIndexName, hashCode, setIndexName
getConnectedItem, getConnectivity, getSignificance, getUniqueID, hasExplicitSignificance, hasUniqueID, setConnectivity, setExplicitSignificance, setSignificance, setUniqueID
addAnnotation, appendHeadingString, clone, getAnnotation, getBytes, getCode, getCreator, getItemType, getLabel, getLanguage, getName, getParent, getWeight, hasAnnotation, hasConnectivityBackLink, isFilter, isFromSpecialToken, isProtected, isRanked, isRoot, putBytes, putString, setCreator, setFilter, setFromSpecialToken, setHasUniqueID, setLabel, setLanguage, setParent, setPositionData, setProtected, setRanked, setWeight, shouldParenthize, toString, usePositionData
finalize, getClass, notify, notifyAll, wait, wait, wait
isStemmed, stringValue
getIndexName, getNumWords
public TermItem()
public TermItem(String indexName)
public TermItem(String indexName, boolean isFromQuery)
public final int encode(ByteBuffer buffer)
protected final void appendBodyString(StringBuilder buffer)
appendBodyString
in class Item
public abstract void setValue(String value)
UnsupportedOperationException
- if this is not supported on this kind of itempublic abstract String getRawWord()
getRawWord
in interface BlockItem
public Substring getOrigin()
public boolean isFromQuery()
isFromQuery
in interface BlockItem
public abstract boolean isWords()
BlockItem
public void setOrigin(Substring origin)
public void disclose(Discloser discloser)
disclose
in class SimpleIndexedItem
public int getTermCount()
getTermCount
in class Item
public boolean isNormalizable()
public void setNormalizable(boolean normalizable)
normalizable
- set to true if accent removal can/should be performedpublic SegmentingRule getSegmentingRule()
BlockItem
getSegmentingRule
in interface BlockItem
public void setSegmentingRule(SegmentingRule segmentingRule)
Copyright © 2018. All rights reserved.