ryan is absolutely right. and if you can't already see it, the problem
is that it's very unscalable to implement even the simplest of search
on gogole app engine. Imagine if someone tries to search with 3 or 4
keywords. You need a separate index for each of those. Depending on
the entity indexed, this can quickly become an exploding index and
soon you'll find that your indexes would be stucked building for days
and eventually erroring out (when rebuilding). We've found this out
the hard way, see my post 
http://zhuocorporation.spaces.live.com/blog/cns!D76A58A7350B0D0B!1824.entry

On Nov 24, 5:43 am, ryan <ryanb+appeng...@google.com> wrote:
> hi anurag! a couple things are going on here. first, you actually do
> need another index. appengine.ext.searchconvertssearchqueries into
> normal queries, with one filter for eachsearchkeyword. so, this:
>
> User.all().search('hug bos').order('-date_joined')
>
> is equivalent to this:
>
> User.gql("WHERE __searchable_text_index = 'hug' AND
> __searchable_text_index = 'bos' ORDER BY date_joined DESC")
>
> so, you need a different index for each different number ofsearch
> keywords that you want to support. specifically, for thissearch
> query, you'd need:
>
> - kind: User
>   properties:
>   - name: __searchable_text_index
>   - name: __searchable_text_index
>   - name: date_joined
>     direction: desc
>
> if you drop the sort order, you no longer need an index because the
> query then has only equals filters. see:
>
> http://code.google.com/appengine/docs/datastore/queriesandindexes.htm...
>
> the second thing, which is causing your confusion, is that the "bo"
> keyword is being ignored due to this constant in appengine/ext/search/
> __init__.py:
>
>   # words shorter than this will not be indexed.searchkeywords
> shorter than
>   # this will be ignored.
>   _FULL_TEXT_MIN_LENGTH = 3
>
> if you want to index andsearchon keywords under 3 characters, you
> can change this constant by adding this code to your main(), or
> somewhere similar:
>
> google.appengine.ext.search._FULL_TEXT_MIN_LENGTH = 1
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to