我最近升级到Spring Data MongoDB 1.6.0.RC1,非常好,并实现了MongoDB 2.6(huuurah!)的全文搜索功能.我的问题是:我如何组合Criteria和TextCriteria类来生成复杂的查询?
示例对象模型:
{
textProperty: "a text that is indexed for full text search",
language:"en",
aBooleanProperty: true,
anIntegerProperty: 1
}
Run Code Online (Sandbox Code Playgroud)
查询:
db.collection({ anIntegerProperty: 1, $text: { $search: "indexed", $language: "en" } })
Run Code Online (Sandbox Code Playgroud)
那么,如何使用Spring Data MongoDB类编写上述查询?