nextcloud / fulltextsearch

🔍 Core of the full-text search framework for Nextcloud
GNU Affero General Public License v3.0
212 stars 51 forks source link

Fallback to default Search if provider is not alive #353

Open newhinton opened 6 years ago

newhinton commented 6 years ago

Currently if the elasticsearch-service is down, the search only shows that. No results are returned (This is as i would expect it). In such a case, it is not possible to execute a search and get results. Maybe we should just return the searchresults which would be returned by the nextcloud-default-search, and a warning of some sort.

ArtificialOwl commented 6 years ago

I would assume that the ES should be up and running at all time, switching back to the old search require a lot of work as I only detect the issue with ES after the creation of the page, when the searchbox is filled

newhinton commented 6 years ago

I see, a "proper" fallback would be complicated then. Would it be possible to deliver the orginal search next to the fulltextsearch? So that if nothing is hidden, there would be two searches? (The default search would be disabled by default of course). If it would be detected that ES is dead, javascript could only toggle visibility on the appropriate tags, and we would have a "fallback".

In the end, you are right, ES should always be alive, and i guess for bigger instances this is not a huge problem since an admin could quickly fix the problem. But for smaller instances, this can take time to fix. Also, regardless of the size of the organization which manages the service, as soon as ES is somehow not reachable, the search is completely down (at least for the time to fix ES) which can be a problem

newhinton commented 6 years ago

@daita I have implemented a fallback if an initial search does not work. I may have to refine the way i detect that the search is down, but this should work as a proof of concept. fallback-branch

ArtificialOwl commented 6 years ago

Can you set a pull request ?