Class Matching
- java.lang.Object
-
- com.yahoo.searchdefinition.document.Matching
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class Matching extends java.lang.Object implements java.lang.Cloneable, java.io.Serializable
Defines how a field should be matched. Matching objects can be compared based on their content, but they are not immutable.- Author:
- bratseth
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Matching.Algorithm
Which match algorithm is used by this matching setupstatic class
Matching.Type
-
Field Summary
Fields Modifier and Type Field Description static Matching.Type
defaultType
-
Constructor Summary
Constructors Constructor Description Matching()
Creates a matching of type "text"Matching(Matching.Type type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Matching
clone()
boolean
equals(java.lang.Object o)
Matching.Algorithm
getAlgorithm()
java.lang.String
getExactMatchTerminator()
If exact matching is used, this returns the terminator string which terminates an exact matched sequence in queries.int
getGramSize()
Returns the gram size, or -1 if not set.Matching.Type
getType()
int
hashCode()
boolean
isAlgorithmUserSet()
boolean
isPrefix()
boolean
isSubstring()
boolean
isSuffix()
boolean
isTypeUserSet()
java.lang.Integer
maxLength()
Matching
maxLength(int maxLength)
void
merge(Matching m)
Merge data from another matching objectvoid
setAlgorithm(Matching.Algorithm algorithm)
void
setExactMatchTerminator(java.lang.String exactMatchTerminator)
Sets the terminator string which terminates an exact matched sequence in queries (used if type is EXACT).void
setGramSize(int gramSize)
void
setType(Matching.Type type)
java.lang.String
toString()
-
-
-
Field Detail
-
defaultType
public static final Matching.Type defaultType
-
-
Constructor Detail
-
Matching
public Matching()
Creates a matching of type "text"
-
Matching
public Matching(Matching.Type type)
-
-
Method Detail
-
getType
public Matching.Type getType()
-
setType
public void setType(Matching.Type type)
-
maxLength
public java.lang.Integer maxLength()
-
maxLength
public Matching maxLength(int maxLength)
-
isTypeUserSet
public boolean isTypeUserSet()
-
getAlgorithm
public Matching.Algorithm getAlgorithm()
-
setAlgorithm
public void setAlgorithm(Matching.Algorithm algorithm)
-
isAlgorithmUserSet
public boolean isAlgorithmUserSet()
-
isPrefix
public boolean isPrefix()
-
isSubstring
public boolean isSubstring()
-
isSuffix
public boolean isSuffix()
-
getGramSize
public int getGramSize()
Returns the gram size, or -1 if not set. Should only be set with gram matching.
-
setGramSize
public void setGramSize(int gramSize)
-
merge
public void merge(Matching m)
Merge data from another matching object
-
getExactMatchTerminator
public java.lang.String getExactMatchTerminator()
If exact matching is used, this returns the terminator string which terminates an exact matched sequence in queries. If exact matching is not used, or no terminator is set, this is null
-
setExactMatchTerminator
public void setExactMatchTerminator(java.lang.String exactMatchTerminator)
Sets the terminator string which terminates an exact matched sequence in queries (used if type is EXACT).
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
clone
public Matching clone()
- Overrides:
clone
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-