多字搜索会导致爆炸指数?

时间:2010-10-18 13:27:31

标签: google-app-engine

我正在尝试使用谷歌应用引擎启用多字搜索。但是,日志中出现如下错误消息

The index for this query is not ready to serve. See the Datastore Indexes page in the Admin Console.
This query needs this index:
- kind: A
  properties:
  - name: __searchable_text_index
  - name: __searchable_text_index
  - name: published
  - name: modified
    direction: desc

我运行的实际查询是

entities = A.all().filter("modified >", timeline).filter("published =", True).filter("modified <=", bookmark ).order("-modified").search(self.request.get('q')).fetch(PAGESIZE+1) 

它适用于一个单词,但对于包含2个或更多单词的短语,它会失败。你知道我应该怎么做吗? 感谢

2 个答案:

答案 0 :(得分:3)

是的,这会导致'爆炸'索引,因为索引条目的数量与实体列表中单词数的平方成正比。

如果删除顺序和不等式过滤器,使用内置的合并连接策略可以满足您的查询,并且可以在内存中对结果进行排序。

答案 1 :(得分:0)

我决定等待谷歌提出一个全文搜索服务,他们现在终于拥有了这个服务。仍然渴望了解它的表现如何。

相关问题