Merge pull request #6788 from svbergerem/improve-search-suggestions
Improve search and mentions suggestions
This commit is contained in:
commit
f073a96b19
2 changed files with 6 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue