开发者

How do I add text search indexes to my Google App Engine app in Python?

开发者 https://www.devze.com 2022-12-14 19:29 出处:网络
I\'ve read about SearchableModel (e.g., here, here, and here).Looks like it has some real limitations, e.g. no ranking (!).

I've read about SearchableModel (e.g., here, here, and here). Looks like it has some real limitations, e.g. no ranking (!).

I've seen gae-search. It looks like its author is too busy to provide support anymore.

开发者_开发百科

Finally, there is a filed issue.

What have people used, and what are your experiences?


SearchableModel. They improve it behind the scenes, so we don't have to.Advice is don't index private fields such as email adresses. Your model also can use geospatial index

class Article(GeoModel, search.SearchableModel)
 text=db.TextProperty(verbose_name="text")
 email=db.EmailProperty(indexed=False,verbose_name="Email")#optional, don't index


If you end up needing to roll-your-own full-text search solution (which i would not advise), have a look at Whoosh. It's written in pure python, so you should be able to get it to run on GAE rather easily. You will have to write classes to handle storage in the GAE datastore though. Normally it uses files.

0

精彩评论

暂无评论...
验证码 换一张
取 消