The exception is doing a good job explaining what SearchableEntity
wants.  For each number of keywords you'll accept during a search,
you'll have to have an index with that many "name:
__searchable_text_index"

And you could easily start hitting the maximum indexed properties
limit of 5000:
http://groups.google.com/group/google-appengine/browse_thread/thread/d5f4dcb7d00ed4c6

See here for exploding indexes:
http://code.google.com/appengine/docs/python/datastore/queriesandindexes.html

So full-text search is not very good right now with SearchableEntity.
I think Google Custom Search API is a better way to go if you can.
-Bill


On Feb 6, 4:41 pm, Ilia Lobsanov <[email protected]> wrote:
> I have entities (model name is Contract) in the datastore created
> using search.SearchableEntity.
>
> This is how I'm searching these entities:
>
>   query = Contract.all().search(keyword)
>   query.order("-contract_date").fetch(10)
>
> When the keyword variable is one word, no exception is raised. If I
> use two words for the keyword, the following exception is raised. If I
> use three words, the exception will talk about wanting three indexes
> on __searchable_text_index
>
> Exception in request:
> Traceback (most recent call last):
>   File "/base/data/home/apps/govtenders/123.331195053078948310/common/
> zip-packages/django.zip/django/core/handlers/base.py", line 86, in
> get_response
>     response = callback(request, *callback_args, **callback_kwargs)
>   File "/base/data/home/apps/govtenders/123.331195053078948310/goat/
> views.py", line 72, in search_by_keyword
>     more_template_params = _process_query(request, query)
>   File "/base/data/home/apps/govtenders/123.331195053078948310/goat/
> views.py", line 139, in _process_query
>     results = query.order("-contract_date").fetch(PAGESIZE+1);
>   File "/base/python_lib/versions/1/google/appengine/ext/db/
> __init__.py", line 1390, in fetch
>     raw = self._get_query().Get(limit, offset)
>   File "/base/python_lib/versions/1/google/appengine/api/
> datastore.py", line 942, in Get
>     return self._Run(limit, offset)._Next(limit)
>   File "/base/python_lib/versions/1/google/appengine/api/
> datastore.py", line 891, in _Run
>     str(exc) + '\nThis query needs this index:\n' + yaml)
> NeedIndexError: no matching index found.
> This query needs this index:
> - kind: Contract
>   properties:
>   - name: __searchable_text_index
>   - name: __searchable_text_index
>   - name: contract_date
>     direction: desc
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to