MongoEngine/mongoengine — pull request #700 by wpjunior (2014-07-07 23:26:10+00:00)
Title: Added support for text search and text_score.

I wrote a support to $text search and textScore to documents.

```python
class News(Document):
title = StringField()
content = StringField()
is_active = BooleanField()

meta = {'indexes': [
{'fields': ['$title', "$content"],
'default_language': 'english',
'weight': {'title': 10, 'content': 2}
}
]}

News(title="Using mongodb text search",
content="Testing text search").save()

News(title="MongoEngine 0.9 released",
content="Various improvements").save()

document = News.objects.search_text('testing', include_text_score=True).first()
document.title # may be: "Using mongodb text search"
document.text_score # may be a float number

document = News.objects.search_text('released').first()
document.title # may be: "MongoEngine 0.9 released"
```

Same alterations is made for `autopep8`