Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- In [1]: from forum.models import Post
- In [2]: from forum.search_indexes import PostIndex
- In [3]: for post in Post.objects.filter(content__icontains=u"spa"): print post.id, post.content
- 3 Spam Ham Eggs
- 4 spam ham eggs
- 5 spammer gonna hate
- 6 spa aplication is the future of web
- 7 SPA aplication is the future of web
- 60 Python eats spaghetti
- In [4]: for post in PostIndex.objects.filter(content__contains=u"spa"): print post.id, post.content
- forum.post.7 SPA aplication is the future of web
- forum.post.6 spa aplication is the future of web
- In [5]: for post in PostIndex.objects.autocomplete(content__contains=u"spa"): print post.id, post.content
- forum.post.7 SPA aplication is the future of web
- forum.post.6 spa aplication is the future of web
- In [6]: for post in PostIndex.objects.autocomplete(text__contains=u"spa"): print post.id, post.content
- forum.post.7 SPA aplication is the future of web
- forum.post.6 spa aplication is the future of web
- In [7]: for post in PostIndex.objects.filter(text__contains=u"spa"): print post.id, post.content
- forum.post.7 SPA aplication is the future of web
- forum.post.6 spa aplication is the future of web
- In [8]: for post in PostIndex.objects.filter(text__contains=u"spam"): print post.id, post.content
- forum.post.3 Spam Ham Eggs
- forum.post.4 spam ham eggs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement