lobid/lodmill — pull request #294 by fsteeg (2014-01-09 09:29:29+00:00)
Title: Switch from n-grams to edge n-grams for suggestions

This change completely switches from n-grams to edge n-grams, so only suggestions where a token *starts* with the query are returned (so both `Thomas Mann` and `Mann, Thomas` yield a result, but no n-grams within a token, e.g. `mas` in this case). This is true for all queries, but as the n-grams were meant for suggestions in the first place, I think this might work as the general behavior.

In an attempt to keep things simple, this commit also removes the manual sorting of results after they are returned from Elasticsearch. This requirement was caused by the overwhelmingly large suggestions list (which this commit solves). It also didn't make much sense conceptually, since it only sorted the paged result returned from Elasticsearch, not the entire result set.

See details and discussion in #264.

Deployed to staging, see http://staging.api.lobid.org/person?name=Thomas+Mann&format=short