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)
|
* 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)
|
* 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)
|
* 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
|
## Bug fixes
|
||||||
* Destroy Participation when removing interactions with a post [#5852](https://github.com/diaspora/diaspora/pull/5852)
|
* 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) {
|
setupBloodhound: function(options) {
|
||||||
var bloodhoundOptions = {
|
var bloodhoundOptions = {
|
||||||
datumTokenizer: function(datum) {
|
datumTokenizer: function(datum) {
|
||||||
var nameTokens = this.bloodhoundTokenizer(datum.name);
|
// hashtags
|
||||||
var handleTokens = datum.handle ? this.bloodhoundTokenizer(datum.handle) : [];
|
if(typeof datum.handle === "undefined") { return [datum.name]; }
|
||||||
return nameTokens.concat(handleTokens);
|
// people
|
||||||
|
if(datum.name === datum.handle) { return [datum.handle]; }
|
||||||
|
return this.bloodhoundTokenizer(datum.name).concat(datum.handle);
|
||||||
}.bind(this),
|
}.bind(this),
|
||||||
queryTokenizer: Bloodhound.tokenizers.whitespace,
|
queryTokenizer: Bloodhound.tokenizers.whitespace,
|
||||||
prefetch: {
|
prefetch: {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue