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

Added fallback if searchresult contains error on initial query #359

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

newhinton
Copy link

Implements #353

@ArtificialOwl
Copy link
Member

I like the idea of switching on error, but not a fan of doing a test request. Also, it needs to be implemented in files_fulltextsearch instead.

I will have a look during the conf/hackweek

@newhinton
Copy link
Author

@daita We can discuss it in person then! ;)

@ArtificialOwl
Copy link
Member

Sure ! this is the whole interest of the conf !

in the meanwhile:
https://github.com/nextcloud/fulltextsearch/blob/master/js/fulltextsearch.v1.navigation.js#L293-L296
is called when
https://github.com/nextcloud/fulltextsearch/blob/master/js/fulltextsearch.v1.api.js#L54

So, if you create a onError method in https://github.com/nextcloud/files_fulltextsearch/blob/master/js/files.js#L219 it should be called when there is an issue requesting the elasticsearch (and/or the nextcloud)

}
self.removeOldSearchbox();
}).fail(function () {
console.log("the searchrequest failed! Reload page.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
console.log("the searchrequest failed! Reload page.");
console.log("the search request failed! Reload the page.");

}
}).done(function (res) {
if (_.has(res, 'error')) {
console.log("there was an error with the search! Contact admin.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
console.log("there was an error with the search! Contact admin.");
console.log("there was an error with the search! Contact an admin.");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants