The MatchScorer (and RescoringMatchScorer) class is 'empty' because it just denotes an option that you can pass to search.SortOptions. You can see how it's used further down in search.py in the method _CopyMatchScorerToScorerSpecProtocolBuffer, where the type is simply checked and an option is set in the protocol buffer accordingly for when the search service is called.
So this answers your question of whether it's possible to implement a custom scorer - no, because the actual scoring is done on the service side at the other end of an RPC, and the option passed must be one of those two classes. The service does work as documented <https://cloud.google.com/appengine/docs/python/search/matchscorerclass> however. On Tuesday, February 14, 2017 at 9:40:44 AM UTC-5, Ivo Bellin Salarin wrote: > > Hello everybody, > > I a using the python GAE. I would like to implement a custom match scorer > which sorts a set of documents according to their timestamp (taking into > account an eventual periodicity of the events; e.g. a sport competition > which takes place every year). > > In search.py I can find two empty implementations of a MatchScorer (the > RescoringMatchScorer and the MatchScorer itself), so I concluded that > they're just stubs for a real implementation elsewhere. > > So, is it possible to implement a custom MatchScorer? > > Thanks in advance, > Ivo > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/google-appengine. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/964a74c4-ded4-476f-ae7f-8eecc6f2cb17%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
