Google App Engine Search API custom scoring
Asked Answered
S

1

9

For a new project I am comparing ElasticSearch and the GAE Search API. What I need is a custom scoring functionality that is able to handle some custom scoring functions, like:

  • lowering the document's score on distance from a specific geopoint (the further away, the lower te score)
  • basing the score on term frequency for full-text searches
  • using "soft" filter/queries: if a filter/query does not match, it does not exclude the document, but just lowers its score

All of this is possible with ElasticSearch, but I can't find a way to implement the third point in GAE Search API. I also can't figure out if the first option just works as a filter in GAE Search API or that it also changes the score of the document. Does anybody know if this is possible?

Sadism answered 17/6, 2014 at 7:56 Comment(5)
I'd guess on the third point you could search against a field that's always present (so always including that document in the results) and then additional search hits will result in a higher score. So no actual search hits still return results?Eventide
We are trying to figure out how to do soft queries as well. Let us say the query phrase is "show all possible items". We want to returns documents that match partially. We tried "(show all possible items) OR (show items) OR (show all items)" This does return results, but the ranking is not untuitive. We would expect one what matched fully, i.e all words matched, to be at the top, but it isn't And it isn't clear how we can do a sort to make this happenSy
They are still working on it... see the answer to this question: "Custom scoring is one of our top priority feature requests" #20659688Tryptophan
Also, you might experiment with the "stemming" operator they provide (prefix search term with "~"): developers.google.com/appengine/docs/python/search/…Tryptophan
If these are your starting requirements, I would go with elastic search. The Search API is cheap and cheerful, but does not have many (many) advanced features you probably will look to in the future. It can't store longs, you can't control it's stemming algorithm, you can't store datetime objects (they all act as dates only), geo searching is very limited (and doesn't work locally), it has no defined consistency behaviour, it can't be transactional and the list goes on. It's a great solution for easily avoiding exploding indexes in the datastore, but it's not elastic search.Philoctetes
D
0

Custom ranking is now possible with Google Custom Search API.

Detinue answered 27/3, 2018 at 23:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.