Coming from Google, the king of search, you would think that they have search in a GAE applications pretty much sorted.
When it came to implementing search on this blog, I started researching the search.SearchableModel when I came across this:
Don't expect too much. First, there's no ranking, which is a killer drawback. There's also no exact phrase match, substring match, boolean operators, stemming, or other common full text search features. Finally, support for stop words (common words that are not indexed) is currently limited to English.
These are all acceptable limitations for a simple blog, but it is going to be a real hurdle for any real application to get over.
Alternatives
Another feasible alternative is the Google AJAX Search API. This is a very simple and easy way to implement search on any site, not just GAE applications.
There are plenty of examples including restricting the search to your site.
The only drawback is that your site really needs to be indexed by Google regularly to get decent results.
My Solution
Thanks to Bill Katz, I am using a version of the Searchable Model that is modified to reduce the index size by excluding unnecessary properties.
For example in my Post model I have a content property which is markdown and a html property that is the processed version of content. Obviously there is no need to index both properties, so I excluded the html property from being indexed.
Currently this means that I am limiting my search to only blog articles and excluding the static pages.
Looking Forward
I hope that GEA gets a better search implementation some time soon. I would really love to see ranking, especially with age decay based on the last time the Model was saved.
Otherwise I will be converting to the AJAX Search API once I hit the limitations.
Comments