-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Advanced search rebased #1473
Advanced search rebased #1473
Conversation
I will handle push/pulls for this separately
@@ -0,0 +1 @@ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for this.
Rebase needed |
We closed OC5 for new features last week. THX for your work |
Conflicts: .gitmodules
Hey @andrewsbrown, sorry if the comments seemed to be all negative, you did some great work here and now that 5.0 is out we can have a look at this again. Could you rebase your code on current master? Then I'll have another look and maybe we can polish this for OC6! |
Ok, give me a few days and I will rebase... |
This commit creates result types for all apps in owncloud/apps that had previously declared providers. It also updates these providers to work with the Advanced Search app and Lucene.
Adds removeProvider() and allows for searching with only one provider.
Ok, so I rebased and pushed, but had to use --force. |
@DeepDiver1975 is this a issue with the pull request or the CI? |
I see some potential XSS holes in this code. Please don't merge this until I've reviewed the code. |
@owncloud-bot retest this please |
@andrewsbrown I've removed the owncloud-apps submodule, because there wasn't any URL specified in .gitmodules |
@kabum, sounds good. |
@andrewsbrown i see some great things, but i think this PR is a bit to big to review properly. For example the app search providers should be in the apps themself. I'm also missing where fillFromId and formatToHtml are called. Can you do a new PR with only the provider for File, which is in core? |
@bartv2 Give me a week or two to look at this again... I didn't really think this would ever get merged so I forgot about it. I'll re-open, though, if you're interested in it. |
@andrewsbrown A better approach is to add many small PRs instead of one really big ... prepare your change step by step and the review will be a lot easier. ;) And don't forget to crosslink between them and mention people you think that they can review it - i.e. current maintainer of this code base or people showed up in this PR;) |
@andrewsbrown the search code can have some love, but in small steps or with a clear proposal. Otherwise there will be a lot of wasted time and code. |
@bartv2 and @kabum: look, I don't know how this project is being run and it was near impossible to figure out when I first tried to use ownCloud. So I built what I wanted to build, which was an app that was listed search results from all searchable apps. To do that, I created or improved search providers for about 10 apps, integrated the Lucene search @butonic implemented, and added the ability to perform actions (edit, delete, etc.) on all types of search results. I get it, it was too many changes and no one understood the scope of the project, especially while it was still in progress (see comments above). I still don't understand who to talk to about this, but I do know that if search needs improving, OC_Search, OC_Search_Provider, and OC_Search_Result need to change. |
@andrewsbrown Thanks a lot for your awesome work. I think @butonic and I are the guys to talk to about your plans. It would be great if you could explain your plans a bit more here. Beside that just go ahead but please with smaller pull requests that are easier to review as @bartv2 suggested. :-) |
@karlitschek, @butonic: So the first thing I think I need is good search results. Right now, OC_Search_Result is a pretty bare affair and if I need search results with as much data as possible. In my implementation, each search result type (e.g. OC_Search_Result_File or OC_Search_Result_Event) has its inherited properties--name, id, etc.--but is extended with applicable properties for that type--created, modified, etc. That is one way to do that, but perhaps a more extensible way is to have a separate Column type and add column data as an object; either way, the goal is to have as much data as possible in the search result so that results can be sorted or queried further. So, besides more data, the other thing they need are Actions. Right now I am creating those the hard way inside a formatToHtml() method; I think this definitely needs to have it's own separate class so I don't have to keep mixing in HTML with the actual code. An action class would have a title, a URL, and permissions; the provider would add Actions to each search result, e.g. an OC_Search_Result_File would have Actions like 'Download', 'Edit', 'Delete', etc. If I had those two things, columns and actions, it would be a good start. The problem is that all of the apps are entrenched in the current search provider/result system and require significant tweaking to change. That's why I went ahead and wrote new providers and new search results for all of the apps included in the 'apps' repository; and that's why this pull request looks so massive. In other words, to make search better/more extensible/more useful in the future, I think we need to significantly modify the current search pattern. But, again, it's a lot of change. |
I think this makes sense. @butonic What do you think? |
In general I like the current solution that returns the search results as JSON. That also works when subclassing the 'abstract' or generic search result. IMO we should change @andrewsbrown could you create a PR that contains the new After that we can work on the client side solution. There is already a customization approach but only the text editor, the deprecated imageviewer, bookmarks and the media app use it. One step after another, and thx for all the effort you already put into this! |
@butonic, I understand you want to keep the HTML generation client-side and I will make the changes as soon as possible. Give me about a week since I am currently out of the country and my Internet access is minimal. |
@butonic, I've been coding this for a bit and I ran into a few questions:
|
@andrewsbrown awesome!
|
Adds the required search providers and search results for the new functionality in the Advanced Search app. To test, checkout the advanced_search_rebased branch on the 3rdparty, core, and app repositories. I have submitted parallel pull requests in 3rdparty pull #7 and apps pull #520.
This work overlaps some of the work @butonic did with the Lucene database but also adds the ability to search all types of search results in one pane. @jancborchardt see as well as these changes could eventually replace the AJAX search dropdown; for this to happen, I think the app would have to be included in core, since it would be a required app.