Commit f073a96b authored by Dennis Schubert's avatar Dennis Schubert
Browse files

Merge pull request #6788 from svbergerem/improve-search-suggestions

Improve search and mentions suggestions
parents a414fb23 75384d50
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -95,6 +95,7 @@ Contributions are very welcome, the hard work is done!
* Prune and do not create aspect visibilities for public posts [#6732](https://github.com/diaspora/diaspora/pull/6732)
* Optimized mobile login and registration forms [#6764](https://github.com/diaspora/diaspora/pull/6764)
* Redesign stream pages [#6535](https://github.com/diaspora/diaspora/pull/6535)
* Improve search and mentions suggestions [#6788](https://github.com/diaspora/diaspora/pull/6788)

## Bug fixes
* Destroy Participation when removing interactions with a post [#5852](https://github.com/diaspora/diaspora/pull/5852)
+5 −3
Original line number Diff line number Diff line
@@ -18,9 +18,11 @@ app.views.SearchBase = app.views.Base.extend({
  setupBloodhound: function(options) {
    var bloodhoundOptions = {
      datumTokenizer: function(datum) {
        var nameTokens = this.bloodhoundTokenizer(datum.name);
        var handleTokens = datum.handle ? this.bloodhoundTokenizer(datum.handle) : [];
        return nameTokens.concat(handleTokens);
        // hashtags
        if(typeof datum.handle === "undefined") { return [datum.name]; }
        // people
        if(datum.name === datum.handle) { return [datum.handle]; }
        return this.bloodhoundTokenizer(datum.name).concat(datum.handle);
      }.bind(this),
      queryTokenizer: Bloodhound.tokenizers.whitespace,
      prefetch: {