views:

36

answers:

1

I'm trying to enable multi-word search with google app engine. However there appears an error message in the log as follows

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

The actual query I run is

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

It works with one word but for phrases with 2 or more words it fails. Do you have any idea how I should do it? Thanks

+1  A: 

Yes, this leads to an 'exploding' index, because the number of index entries is proportional to the square of the number of words in the entity's list.

If you drop the order and inequality filters, your query will be satisfiable using the built in merge join strategy, and you can sort the results in memory.

Nick Johnson
Thanks Nick! It works dropping the order and inequality filters. Sorting is quite simple inmemory now leading to question how I do something like filter("modified >", timeline) and fetch(PAGESIZE+1) inmemory.
LarsOn