我浏览了文档,并尝试遵循github上的代码示例,但我仍然感到困惑
这是程序吗
1)生成索引:
index = search.Index(name = "geoSearch")
2)定义字段:
ID = #my ID
geopoint = #a lat long coordinate
fields = [
search.TextField(name = "ID", value = ID),
search.GeoField(name = "location" , value = geopoint) ]
3)创建文档以存储字段:
doc = search.Document(fields = fields)
4)然后我将遍历,并将“字段”添加到文档中,每次添加一个,如下所示:
search.Index(name = "geoSearch").add(doc)
一旦我完成了遍历,我就会有一个搜索索引?这看起来合理吗?谢谢
请注意,还需要索引配置文件: https://developers.google.com/appengine/docs/python/config/indexconfig
相关问题 更多 >
编程相关推荐