[google-appengine] Re: Ideas for a bit more advanced search
On 22 фев, 00:36, Steffen 'stefreak' Neubauer wrote: > I want to implement a search that is a bit advanced and searching for > some ideas on how to implement it. > > For now, my ranking is an int property for each document, i'll sort the > results by that property. > To search my documents i'll use ListProperty (with substrings, e.g. > for green [gr,gre,gree,green], maybe with reverse too ([en,een,reen])) > and the = operator i think. Why not apply a stemmer to all words and then keep a single (stemmed) version? > But i have no idea how to implement the " search operator (search for > "Debian 5.0" for example). Has anyone an idea? Or proposals how to > implement it a better way? Here's one silly idea: class Occurence(db.Model): keyword = db.ReferenceProperty (Keyword) document = db.IntegerProperty () termPositions = db.ListProperty (int) For every matched document you get the termPositions of both terms and see if the second one contains a position which is +1 from the first one... --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[google-appengine] Re: Full page memcache caching and HTTP status in logs
> Hmm no, it's not perfect :) The client gets a 200 if it's cached and a > 404 if it's not cached. How do i send a 404 to the client without > touching the webapp framework? Could not find anything. You need to use the standard CGI "Status" header. print ('Status: 404') print ('Content-Type: text/html') See http://www.apps.ietf.org/rfc/rfc3875.html#sec-6.3.3 --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[google-appengine] Re: Full page memcache caching and HTTP status in logs
> Hmm no, it's not perfect :) The client gets a 200 if it's cached and a > 404 if it's not cached. How do i send a 404 to the client without > touching the webapp framework? Could not find anything. > > Thank you. http://www.apps.ietf.org/rfc/rfc3875.html#sec-6.3.3 print ('Status: ' + str(httpStatus)) or print ('Status: 404') --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---