public interface StringSearchConstraint extends FieldConstraint
In addition to searchterms, a search type and a match type can be specified:
The search type specifies how the search is performed: Must be one of:
SEARCH_TYPE_WORD_ORIENTED
- searches for the most occurrences of the words in the search terms.
Order and proximity of words is not significant.
SEARCH_TYPE_PHRASE_ORIENTED
- searches for occurrence of the sequence of words in the search terms.
SEARCH_TYPE_PROXIMITY_ORIENTED
- searches for the most occurrences of the words within a given
word distance.
Order of words is not important.
The match type specifies how individual words in the search terms are matched with words in the searched text.
MATCH_TYPE_LITERAL
- exact match only
MATCH_TYPE_FUZZY
- fuzzy match: matches words within the specified number of
typo's as well (specified by parameter PARAM_FUZZINESS)
MATCH_TYPE_SYNONYM
- matches synonyms as well
The searchterms may containt the following wildchard characters as well:
Depending on searchtype and searchmode, the following parameters can be set:
PARAM_FUZZINESS
- Float, specifies maximum allowed number of
typo's per word, expressed as fraction of word length.
(E.g. 0,2 means: maximum 2 typo's for 10 letter words.).MATCH_TYPE_FUZZY.
It can only be set for this match type, and is cleared when
the match type is set to another value.
PARAM_PROXIMITY_LIMIT
- Integer, specifies maximum distance between
searched words.SEARCH_TYPE_PROXIMITY_ORIENTED.
It can only be set for this search type, and is cleared when
the search type is set to another value.
| Modifier and Type | Field and Description |
|---|---|
static String[] |
MATCH_TYPE_DESCRIPTIONS
Match type descriptions corresponding to the match type values:
MATCH_TYPE_LITERAL, MATCH_TYPE_FUZZY, and
MATCH_TYPE_SYNONYM |
static int |
MATCH_TYPE_FUZZY
Match type for fuzzy matching.
|
static int |
MATCH_TYPE_LITERAL
Match type for literal matching.
|
static int |
MATCH_TYPE_SYNONYM
Match type for synonym matching.
|
static String |
PARAM_FUZZINESS
Name for parameter specifying fuzziness for fuzzy matching.
|
static String |
PARAM_PROXIMITY_LIMIT
Name for parameter specifying proximity limit for
proximity oriented search.
|
static String[] |
SEARCH_TYPE_DESCRIPTIONS
Search type descriptions corresponding to the search type values:
SEARCH_TYPE_WORD_ORIENTED, SEARCH_TYPE_PHRASE_ORIENTED, and
SEARCH_TYPE_PROXIMITY_ORIENTED |
static int |
SEARCH_TYPE_PHRASE_ORIENTED
Search type for phrase oriented search.
|
static int |
SEARCH_TYPE_PROXIMITY_ORIENTED
Search type for proximity oriented search.
|
static int |
SEARCH_TYPE_WORD_ORIENTED
Search type for word oriented search.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getMatchType()
Gets the match type.
|
Map<String,Object> |
getParameters()
Gets value of additional parameters.
|
List<String> |
getSearchTerms()
Gets the list of searchterms.
|
int |
getSearchType()
Gets the search type, this specifies how the search is performed.
|
String |
toString()
Returns a string representation of this StringSearchConstraint.
|
getField, isCaseSensitive, matchesequals, getBasicSupportLevel, hashCode, isInverse, setUnmodifiablestatic final int SEARCH_TYPE_WORD_ORIENTED
static final int SEARCH_TYPE_PHRASE_ORIENTED
static final int SEARCH_TYPE_PROXIMITY_ORIENTED
static final String[] SEARCH_TYPE_DESCRIPTIONS
SEARCH_TYPE_WORD_ORIENTED, SEARCH_TYPE_PHRASE_ORIENTED, and
SEARCH_TYPE_PROXIMITY_ORIENTEDstatic final int MATCH_TYPE_LITERAL
static final int MATCH_TYPE_FUZZY
static final int MATCH_TYPE_SYNONYM
static final String[] MATCH_TYPE_DESCRIPTIONS
MATCH_TYPE_LITERAL, MATCH_TYPE_FUZZY, and
MATCH_TYPE_SYNONYMstatic final String PARAM_FUZZINESS
static final String PARAM_PROXIMITY_LIMIT
int getSearchType()
Map<String,Object> getParameters()
int getMatchType()
List<String> getSearchTerms()
String toString()
isInverse()
getField().getAlias()
isCaseSensitive()
getSearchType()
getMatchType()
getParameters()
getParameters()MMBase 1.9-SNAPSHOT - ${javadoctimestamp}