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

Use the search bar to search for files by tag #326

Closed
totalcaos opened this issue Jul 6, 2016 · 17 comments · Fixed by #26813
Closed

Use the search bar to search for files by tag #326

totalcaos opened this issue Jul 6, 2016 · 17 comments · Fixed by #26813

Comments

@totalcaos
Copy link

Currently to find files/folders with a particular tag within NextCloud you need to go to the "Tags" menu option then type in or select the tag(s) that you want to filter with.

Using the search function, it is not possible to search for files/folders with a specified tag as it does a full text search of the files, but not the associated tag.

Can the search function be enhanced to search for not only the full text/file names but also for the tag(s) associated with a file? Another possible enhancement of the search can be to search for keywords entered in the search function within the comments associated with a file/folder

@totalcaos totalcaos changed the title Use the search bar to search for files by tag Feature Request: Use the search bar to search for files by tag Jul 6, 2016
@Bugsbane
Copy link
Member

Bugsbane commented Jul 7, 2016

It makes sense to list files that the user has specifically chosen to associate with the searchphrase, even more highly than if the word just appears in the content / filename somewhere.

I second that we should list these files when a user types in the tag name, preferably above other listings.

I would also love to see the ability to limit search results just to files tagged with a syntax like in GitHub, eg: tag:holiday2016

@MariusBluem MariusBluem changed the title Feature Request: Use the search bar to search for files by tag Use the search bar to search for files by tag Jul 7, 2016
@jancborchardt
Copy link
Member

Yeah, actually the full »Tags« functionality in the sidebar is nothing other than a search. We should combine that part with the actual search to make it more useful.

@totalcaos
Copy link
Author

@jakobsack Indeed! When you have terrabytes of data, the search functionality becomes critical. What are we using to power the search? Is it the Zend_Search engine?

@Bugsbane
Copy link
Member

From memory, I think I recall it being Lucene...

@totalcaos
Copy link
Author

totalcaos commented Jul 13, 2016

Hmmm ... doesn't look like it from the code. Although there's a very good chance I may be wrong :)

edit
There is a "Search Lucene" app in the owncloud appstore, but that's apparently only supports OC up to version 8.2. The limitation is that it only indexes files "per user" and not globally https://github.com/owncloud/search_lucene/issues/10

The question is; is this the path we will look to go down or develop a more "enterprise" global search function here?

@Bugsbane
Copy link
Member

You're probably not wrong. I'm remembering this from a long time ago (like OC 5 or something)

@nextcloud-bot nextcloud-bot added the stale Ticket or PR with no recent activity label Jun 20, 2018
@skjnldsv skjnldsv added the 1. to develop Accepted and waiting to be taken care of label Jun 12, 2019
@ghost ghost removed the stale Ticket or PR with no recent activity label Jun 12, 2019
@da3dsoul
Copy link

da3dsoul commented Jun 19, 2019

It also needs to be faster. If people really use tags, then it's not unreasonable to expect this for 3 minutes:
chrome_2019-06-19_01-43-45

Followed by a 5 minute hang when you type a letter....
That's after aggressive caching and adding indexes to the systemtag and systemtag_object_mapping tabled.
AnyDesk_2019-06-19_01-57-03
I don't even think that's unreasonable, really. The issue isn't with the database queries. Those are almost instantaneous with my setup, but the webui still grinds to a halt trying to deal with it.

From DataGrip:

sql> Select fileid, filecache.name from filecache inner join systemtag_object_mapping on fileid = objectid inner join systemtag on systemtagid = id where systemtag.name = 'girls_frontline'
[2019-06-19 02:07:50] 1415 rows retrieved starting from 1 in 52 ms (execution: 7 ms, fetching: 45 ms)

Assuming we kept the ID of the systemtag when we select it in the list, then we can cut out a join and act on systemtag_object_mapping.systemtagid

sql> Select fileid, filecache.name from filecache inner join systemtag_object_mapping on fileid = objectid where systemtagid = 5500
[2019-06-19 02:11:00] 1415 rows retrieved starting from 1 in 44 ms (execution: 7 ms, fetching: 37 ms)

Even faster, and that counts time that DataGrip uses to process and render the results. Faster still if I didn't include the filecache.name for readability and validation of the results. Each item could be looked up separately in lazy loading by fileid.
When I limit it to 50 result batches (the id is an asc index, so it'll order itself), it's ridiculously fast.

sql> Select fileid from filecache inner join systemtag_object_mapping on fileid = objectid where systemtagid = 5500 limit 50
[2019-06-19 02:15:57] 50 rows retrieved starting from 1 in 11 ms (execution: 5 ms, fetching: 6 ms)

EDIT: I realize after the fact that I forgot objecttype = 'files' and, but it yielded very similar numbers, within the error of margin on other system tasks. objecttype is indexed, too, after all.

@jancborchardt
Copy link
Member

@da3dsoul thanks for the intense research! It is a different issue though, as this is about enhancing the search field to include tags.

Since your comment is about improving the performance, could you open a separate issue for that? Thanks! :)

@da3dsoul
Copy link

I absolutely can. I brought it here because it's directly a problem with implementing it. If you put it in, then the search bar would lock the whole page any time you clicked on it.

@jancborchardt
Copy link
Member

@rullzer @MorrisJobke @daita maybe you can give @da3dsoul some pointers? :)

@da3dsoul
Copy link

da3dsoul commented Feb 4, 2020

#17499 The optimization issue I made regarding this, for the sake of them having a reference to one another

@antonkarliner
Copy link

Competely agree with the initial topic, ability to include tags in search would be a bless

@BloodyIron

This comment has been minimized.

@XueSheng-GIT
Copy link

I was just starting to use the tag feature (using NC21) and realized that I can't find the tagged files afterwards. Is the "Tags" Category still the only way to find tagged files?

marcelklehr added a commit that referenced this issue Apr 28, 2021
marcelklehr added a commit that referenced this issue Apr 28, 2021
marcelklehr added a commit that referenced this issue Apr 28, 2021
marcelklehr added a commit that referenced this issue Apr 29, 2021
marcelklehr added a commit that referenced this issue Apr 29, 2021
fixes #326

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
marcelklehr added a commit that referenced this issue Apr 29, 2021
fixes #326

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
marcelklehr added a commit that referenced this issue Apr 29, 2021
fixes #326

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
marcelklehr added a commit that referenced this issue Apr 29, 2021
fixes #326

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
@szaimen szaimen added 2. developing Work in progress and removed 1. to develop Accepted and waiting to be taken care of labels Jun 18, 2021
marcelklehr added a commit that referenced this issue Jun 22, 2021
fixes #326

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
marcelklehr added a commit that referenced this issue Jun 22, 2021
fixes #326

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
nextcloud-command pushed a commit that referenced this issue Sep 13, 2021
fixes #326

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
@Alseenrodelap
Copy link

It's been 6 years and this basic functionality hasn't been implemented.

@BloodyIron
Copy link

Yeah why hasn't this been implemented? Tags are generally useless without searching by them. That's often the whole point of tags in any system.

marcelklehr added a commit that referenced this issue May 9, 2022
fixes #326

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
marcelklehr added a commit that referenced this issue May 17, 2022
fixes #326

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
marcelklehr added a commit that referenced this issue May 17, 2022
fixes #326

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
@BloodyIron
Copy link

yay! \o/

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

Successfully merging a pull request may close this issue.