java.lang.Object
org.springframework.data.mongodb.core.query.TextCriteria
- All Implemented Interfaces:
CriteriaDefinition
Implementation of
CriteriaDefinition to be used for full text search.- Since:
- 1.6
- Author:
- Christoph Strobl, Oliver Gierke, Mark Paluch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncaseSensitive(boolean caseSensitive) Optionally enable or disable case sensitive search.diacriticSensitive(boolean diacriticSensitive) Optionally enable or disable diacritic sensitive search against version 3 text indexes.booleanstatic TextCriteriaReturns a newTextCriteriafor the default language.static TextCriteriaforLanguage(String language) For a full list of supported languages see the mongodb reference manual for Text Search Languages.org.bson.DocumentGetDocumentrepresentation.getKey()Get the identifying key.inthashCode()Adds givenTermto criteria.matchingAny(String... words) Configures theTextCriteriato match any of the given words.matchingPhrase(String phrase) Given value will treated as a single phrase.notMatching(String term) notMatchingAny(String... words) notMatchingPhrase(String phrase) Given value will treated as a single phrase.
-
Constructor Details
-
TextCriteria
public TextCriteria()Creates a newTextCriteria.- See Also:
-
-
Method Details
-
forDefaultLanguage
Returns a newTextCriteriafor the default language.- Returns:
-
forLanguage
For a full list of supported languages see the mongodb reference manual for Text Search Languages.- Parameters:
language-- Returns:
-
matchingAny
Configures theTextCriteriato match any of the given words.- Parameters:
words- the words to match.- Returns:
-
matching
Adds givenTermto criteria.- Parameters:
term- must not be null.
-
matching
- Parameters:
term-- Returns:
-
notMatching
- Parameters:
term-- Returns:
-
notMatchingAny
- Parameters:
words-- Returns:
-
notMatchingPhrase
Given value will treated as a single phrase.- Parameters:
phrase-- Returns:
-
matchingPhrase
Given value will treated as a single phrase.- Parameters:
phrase-- Returns:
-
caseSensitive
Optionally enable or disable case sensitive search.- Parameters:
caseSensitive- boolean flag to enable/disable.- Returns:
- never null.
- Since:
- 1.10
-
diacriticSensitive
Optionally enable or disable diacritic sensitive search against version 3 text indexes.- Parameters:
diacriticSensitive- boolean flag to enable/disable.- Returns:
- never null.
- Since:
- 1.10
-
getKey
Description copied from interface:CriteriaDefinitionGet the identifying key.- Specified by:
getKeyin interfaceCriteriaDefinition- Returns:
- can be null.
-
getCriteriaObject
public org.bson.Document getCriteriaObject()Description copied from interface:CriteriaDefinitionGetDocumentrepresentation.- Specified by:
getCriteriaObjectin interfaceCriteriaDefinition- Returns:
- never null.
-
equals
-
hashCode
public int hashCode()
-