Tratto da un post nel gruppo Google ( https:// groups.google.com/forum/?fromgroups#!topic/mongodb-user/7jWUbunUcFQ ):
final DBObject textSearchCommand = new BasicDBObject();
textSearchCommand.put("text", collectionName);
textSearchCommand.put("search", textToSearchFor);
final CommandResult commandResult = db.command(textSearchCommand);
Mostra esattamente come formattare il comando.