On Mar 30, 3:08 pm, Jeff S <[email protected]> wrote:
> Excellent observation, creating an index to allow searches on two
> keywords, three keyword, four keywords, etc. will also almost
> certainly lead to "exploding indexes" as described 
> here:http://code.google.com/appengine/docs/python/datastore/queriesandinde...
> . Would it be possible to use an "in" query instead?
>
> http://jscudder.mtv.corp.google.com:6346/appengine/docs/python/datast...

Make that

http://code.google.com/appengine/docs/python/datastore/queriesandindexes.html#Introducing_Queries

>
> If not,  it may be possible to do some of the ordering or filtering in
> memory. depending on the number of entities which you are working
> with. You could approximate this effect by performing one query per
> keyword entered and taking the union (though you might end up finding
> fewer matches than exist).
>
> Thank you,
>
> Jeff
>
> On Mar 29, 11:41 am, MajorProgamming <[email protected]> wrote:
>
> > Basically I currently have a search system set up in my app. The code
> > looks something like the following:
>
> > wx=db.Query(Items)
> > for word in q2.split(' '):
> >         wx.filter('keywords =',word.lower())
> > wx.order('rank')
>
> > I also have an index:
> > - kind: Items
> >   properties:
> >   - name: keywords
> >   - name: rank
>
> > So basically I take the users query, split it into words, filter
> > (using an "and" operator) on all the words, and then want to rank the
> > items based on an integer. This works fine when the user enters one
> > word. However, when the user enters two words the app says it needs
> > more indexes:
>
> > - kind: Items
> >   properties:
> >   - name: keywords
> >   - name: keywords
> >   - name: rank
>
> > This obviously isn't very good for scaling, because I would have to
> > create MANY indexes. Is there any other way to do this?
>
> > Note: If I take out the order operation, it works fine on multiple
> > word queries. It's only when I add on the order by rank operation that
> > it asks for more indexes.
>
> > Thanks for your help,
--~--~---------~--~----~------------~-------~--~----~
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