Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document title typeahead results #744

Open
terba opened this issue Jan 4, 2024 · 0 comments
Open

Document title typeahead results #744

terba opened this issue Jan 4, 2024 · 0 comments

Comments

@terba
Copy link

terba commented Jan 4, 2024

The results for the document title typeahead search are most of the time not what I was expecting. So I changed the sort order to descending, the sort column to 3 and the limit to 10 in DocumentEdit.js. It is much better now, as it offers the latest documents matching the typed text.

  /**
   * Returns a promise for typeahead title.
   */
  $scope.getTitleTypeahead = function($viewValue) {
    var deferred = $q.defer();
    Restangular.one('document/list')
    .get({
      limit: 10,
      sort_column: 3,
      asc: false,
      search: $viewValue
    }).then(function(data) {
      deferred.resolve(_.uniq(_.pluck(data.documents, 'title'), true));
    });
    return deferred.promise;
  };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants