Class TextCriteria
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
-
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.boolean
static TextCriteria
Returns a newTextCriteria
for the default language.static TextCriteria
forLanguage
(String language) For a full list of supported languages see the mongodb reference manual for Text Search Languages.org.bson.Document
GetDocument
representation.getKey()
Get the identifying key.int
hashCode()
Adds givenTerm
to criteria.matchingAny
(String... words) Configures theTextCriteria
to 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 newTextCriteria
for 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 theTextCriteria
to match any of the given words.- Parameters:
words
- the words to match.- Returns:
-
matching
Adds givenTerm
to 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:CriteriaDefinition
Get the identifying key.- Specified by:
getKey
in interfaceCriteriaDefinition
- Returns:
- can be null.
-
getCriteriaObject
public org.bson.Document getCriteriaObject()Description copied from interface:CriteriaDefinition
GetDocument
representation.- Specified by:
getCriteriaObject
in interfaceCriteriaDefinition
- Returns:
- never null.
-
equals
-
hashCode
public int hashCode()
-