DATAMONGO-1455, DATAMONGO-1456 - Add support for $caseSensitive and $diacriticSensitive to $text.
We added methods to set values for $caseSensitive and $diacriticSensitive when using TextCriteria. Both operators are optional and will not be used until explicitly set.
// { "$text" : { "$search" : "coffee" , "$caseSensitive" : true } }
TextCriteria.forDefaultLanguage().matching("coffee").caseSensitive(true);
// { "$text" : { "$search" : "coffee" , "$diacriticSensitive" : true } }
TextCriteria.forDefaultLanguage().matching("coffee").diacriticSensitive(true);
Original pull request: #375.
This commit is contained in:
committed by
Mark Paluch
parent
116baf9a92
commit
ac55f5e77f
@@ -1356,6 +1356,8 @@ TextQuery.searching(new TextCriteria().matching("\"coffee cake\""));
|
||||
TextQuery.searching(new TextCriteria().phrase("coffee cake"));
|
||||
----
|
||||
|
||||
The flags for `$caseSensitive` and `$diacriticSensitive` can be set via the according methods on `TextCriteria`. Please note that these two optional flags have been introduced in MongoDB 3.2 and will not be included in the query unless explicitly set.
|
||||
|
||||
include::../{spring-data-commons-docs}/query-by-example.adoc[leveloffset=+1]
|
||||
include::query-by-example.adoc[leveloffset=+1]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user