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

new feature: searchFilesByTag #23

Closed
aleks365 opened this issue Jun 21, 2020 · 8 comments
Closed

new feature: searchFilesByTag #23

aleks365 opened this issue Jun 21, 2020 · 8 comments

Comments

@aleks365
Copy link

Hi. Is there a chance to add a search function for files after specific idTag or nameTag?

@aleks365 aleks365 changed the title new feature: searchFileByTag new feature: searchFilesByTag Jun 21, 2020
@hobigo
Copy link
Owner

hobigo commented Jun 22, 2020

Request:

fetch("....../remote.php/dav/files/<userid>/", {
  "headers": {
    "accept": "*/*",
    "content-type": "text/plain;charset=UTF-8",
  },
  "body": "<oc:filter-files  xmlns:d=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\" xmlns:nc=\"http://nextcloud.org/ns\" xmlns:ocs=\"http://open-collaboration-services.org/ns\">\n    <d:prop>\n        <d:getlastmodified />\n        <d:getetag />\n        <d:getcontenttype />\n        <d:resourcetype />\n        <oc:fileid />\n        <oc:permissions />\n        <oc:size />\n        <d:getcontentlength />\n        <nc:has-preview />\n        <nc:mount-type />\n        <nc:is-encrypted />\n        <ocs:share-permissions />\n        <oc:tags />\n        <oc:favorite />\n        <oc:comments-unread />\n        <oc:owner-id />\n        <oc:owner-display-name />\n        <oc:share-types />\n    </d:prop>\n    <oc:filter-rules>\n        <oc:systemtag>290</oc:systemtag>\n    </oc:filter-rules>\n</oc:filter-files>\n",
  "method": "REPORT",
});

AND

 <oc:filter-rules>
        <oc:systemtag>290</oc:systemtag>
        <oc:systemtag>289</oc:systemtag>
    </oc:filter-rules>

@hobigo
Copy link
Owner

hobigo commented Jun 22, 2020

Response is a mutistatus 207 for files:
open
limit and count

@hobigo
Copy link
Owner

hobigo commented Jun 22, 2020

Hi aleks365,
I'll put it on my list for the next release.
It is possible to do it.
I don't know how fast it is.
limiting and paging is currently not clear

@hobigo
Copy link
Owner

hobigo commented Jun 22, 2020

open pull request for paging and limiting on nextcloud server side.
nextcloud/server#10880
I would consider the non ability to limit the response as a security bug...

@aleks365
Copy link
Author

Hobigo, thank you for your interest.

...
I'll put it on my list for the next release.
It is possible to do it.
I don't know how fast it is.
limiting and paging is currently not clear

I would consider the non ability to limit the response as a security bug...

sure, I'm waiting for the next release

@hobigo
Copy link
Owner

hobigo commented Jun 23, 2020

Hi aleks365,
v1.4.0 contains the function - client.getFileSystemObjectByTags

Please find an example how to use it here:
https://github.com/hobigo/nextcloud-node-client#examples
Tagging

would be intersting to know what you are doing with this function
regards hobigo

@aleks365
Copy link
Author

Hobigo, thank you for the quick release

I use this for file storage and image classification

// A simplified version
const tag = await client.getTagById(5);
const fse = await client.getFileSystemElementByTags([tag]);

const file = fse[0];

// I am sending binary data to the TensorFlow service
const url = file.getUrl();
// axios...

// Deleting file from queue
await file.removeTag('queue');

I download files from the queue and then pass binary data to the TensorFlow service. In this way, the TensorFlow service adds more tags.
The code on production looks different but I simplified it for the needs of the example.
If you would like to know something more, let me know

@hobigo
Copy link
Owner

hobigo commented Jun 25, 2020

Hi aleks365 ,
got it.
This project has been created for a similar reasons - OCR processing of images, text extraction and text analysis for search.
I used "shaddow" files in nextcould (starting with ".") to track the processing state and store the results for the file.
Actually a cool feature of nextcloud.

Using a tag to "send" the files TensorFlow is a good idea.
Thanks for sharing your thougths.

hobigo

@hobigo hobigo closed this as completed Jun 29, 2020
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

No branches or pull requests

2 participants