public class SuggestQueryConfig
extends java.lang.Object
implements com.exalead.util.Checkable, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
boolean |
autocomplete |
static boolean |
DEFAULT_AUTOCOMPLETE |
static int |
DEFAULT_DISTANCE |
static int |
DEFAULT_MIN_LENGTH_FOR_DISTANCE1 |
static int |
DEFAULT_MIN_LENGTH_FOR_DISTANCE2 |
static boolean |
DEFAULT_RECURSIVE |
static int |
DEFAULT_SECURE_SUGGEST_TIMEOUT_M_S |
int |
distance |
int |
minLengthForDistance1 |
int |
minLengthForDistance2 |
boolean |
recursive |
int |
secureSuggestTimeoutMS |
Constructor and Description |
---|
SuggestQueryConfig() |
SuggestQueryConfig(SuggestQueryConfig o)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
void |
check(boolean deep,
java.lang.String errorContext)
Checks this SuggestQueryConfig.
|
static SuggestQueryConfig |
fromString(java.lang.String s)
String representation of this SuggestQueryConfig.
|
int |
getDistance()
Allows approximate matching.
|
int |
getMinLengthForDistance1()
Only searches for distance 1 fuzzy matches if the original word in the query is at least N characters long.
This avoids too much approximation on very short words. The default value is 3. |
int |
getMinLengthForDistance2()
Only searches for distance 2 fuzzy matches if the original word in the query is at least N characters long.
This avoids too much approximation on very short words. The default value is 6. |
int |
getSecureSuggestTimeoutMS()
Aborts matching in a secure suggest when this time limit is reached.
|
boolean |
isAutocomplete()
Only works with a suggest built with subString or subExpr options.
If set, the query is not replaced by the suggest results, instead, the results are appended to the query being typed in order to auto complete it. |
boolean |
isRecursive()
Discards the leftmost word of the query progressively.
|
SuggestQueryConfig |
makeCopy()
Creates and returns a deep copy of this SuggestQueryConfig.
|
static SuggestQueryConfig |
readFrom(java.io.InputStream is)
Read this SuggestQueryConfig from an XML fragment.
|
void |
setAutocomplete(boolean autocomplete)
Only works with a suggest built with subString or subExpr options.
If set, the query is not replaced by the suggest results, instead, the results are appended to the query being typed in order to auto complete it. |
void |
setDistance(int distance)
Allows approximate matching.
|
void |
setMinLengthForDistance1(int minLengthForDistance1)
Only searches for distance 1 fuzzy matches if the original word in the query is at least N characters long.
This avoids too much approximation on very short words. The default value is 3. |
void |
setMinLengthForDistance2(int minLengthForDistance2)
Only searches for distance 2 fuzzy matches if the original word in the query is at least N characters long.
This avoids too much approximation on very short words. The default value is 6. |
void |
setRecursive(boolean recursive)
Discards the leftmost word of the query progressively.
|
void |
setSecureSuggestTimeoutMS(int secureSuggestTimeoutMS)
Aborts matching in a secure suggest when this time limit is reached.
|
java.lang.String |
toString()
String representation of this SuggestQueryConfig.
|
SuggestQueryConfig |
withAutocomplete(boolean autocomplete) |
SuggestQueryConfig |
withAutocomplete(java.lang.Boolean autocomplete) |
SuggestQueryConfig |
withDistance(int distance) |
SuggestQueryConfig |
withDistance(java.lang.Integer distance) |
SuggestQueryConfig |
withMinLengthForDistance1(int minLengthForDistance1) |
SuggestQueryConfig |
withMinLengthForDistance1(java.lang.Integer minLengthForDistance1) |
SuggestQueryConfig |
withMinLengthForDistance2(int minLengthForDistance2) |
SuggestQueryConfig |
withMinLengthForDistance2(java.lang.Integer minLengthForDistance2) |
SuggestQueryConfig |
withRecursive(boolean recursive) |
SuggestQueryConfig |
withRecursive(java.lang.Boolean recursive) |
SuggestQueryConfig |
withSecureSuggestTimeoutMS(int secureSuggestTimeoutMS) |
SuggestQueryConfig |
withSecureSuggestTimeoutMS(java.lang.Integer secureSuggestTimeoutMS) |
void |
writeTo(java.io.OutputStream os)
Write this SuggestQueryConfig as an XML fragment
|
public int distance
public static final int DEFAULT_DISTANCE
public int minLengthForDistance1
public static final int DEFAULT_MIN_LENGTH_FOR_DISTANCE1
public int minLengthForDistance2
public static final int DEFAULT_MIN_LENGTH_FOR_DISTANCE2
public boolean autocomplete
public static final boolean DEFAULT_AUTOCOMPLETE
public boolean recursive
public static final boolean DEFAULT_RECURSIVE
public int secureSuggestTimeoutMS
public static final int DEFAULT_SECURE_SUGGEST_TIMEOUT_M_S
public SuggestQueryConfig()
public SuggestQueryConfig(SuggestQueryConfig o)
public void setDistance(int distance)
public int getDistance()
public SuggestQueryConfig withDistance(int distance)
public SuggestQueryConfig withDistance(java.lang.Integer distance)
public void setMinLengthForDistance1(int minLengthForDistance1)
public int getMinLengthForDistance1()
public SuggestQueryConfig withMinLengthForDistance1(int minLengthForDistance1)
public SuggestQueryConfig withMinLengthForDistance1(java.lang.Integer minLengthForDistance1)
public void setMinLengthForDistance2(int minLengthForDistance2)
public int getMinLengthForDistance2()
public SuggestQueryConfig withMinLengthForDistance2(int minLengthForDistance2)
public SuggestQueryConfig withMinLengthForDistance2(java.lang.Integer minLengthForDistance2)
public void setAutocomplete(boolean autocomplete)
public boolean isAutocomplete()
public SuggestQueryConfig withAutocomplete(boolean autocomplete)
public SuggestQueryConfig withAutocomplete(java.lang.Boolean autocomplete)
public void setRecursive(boolean recursive)
public boolean isRecursive()
public SuggestQueryConfig withRecursive(boolean recursive)
public SuggestQueryConfig withRecursive(java.lang.Boolean recursive)
public void setSecureSuggestTimeoutMS(int secureSuggestTimeoutMS)
public int getSecureSuggestTimeoutMS()
public SuggestQueryConfig withSecureSuggestTimeoutMS(int secureSuggestTimeoutMS)
public SuggestQueryConfig withSecureSuggestTimeoutMS(java.lang.Integer secureSuggestTimeoutMS)
public SuggestQueryConfig makeCopy()
public static SuggestQueryConfig readFrom(java.io.InputStream is) throws javax.xml.bind.JAXBException
javax.xml.bind.JAXBException
public void writeTo(java.io.OutputStream os) throws javax.xml.bind.JAXBException, java.io.IOException
javax.xml.bind.JAXBException
java.io.IOException
public static SuggestQueryConfig fromString(java.lang.String s) throws javax.xml.bind.JAXBException, java.io.UnsupportedEncodingException
javax.xml.bind.JAXBException
java.io.UnsupportedEncodingException
public java.lang.String toString()
toString
in class java.lang.Object
public void check(boolean deep, java.lang.String errorContext) throws com.exalead.util.TypedException
check
in interface com.exalead.util.Checkable
com.exalead.util.TypedException
Copyright © 2021 Dassault Systèmes, All Rights Reserved.