-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
feat: Use file cache query builder for searching for favorites #39303
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -295,8 +295,8 @@ public function searchByMime($mimetype) { | |
* @param string $userId owner of the tags | ||
* @return Node[] | ||
*/ | ||
public function searchByTag($tag, $userId) { | ||
$query = $this->queryFromOperator(new SearchComparison(ISearchComparison::COMPARE_EQUAL, 'tagname', $tag), $userId); | ||
public function searchByTag($tag, $userId, int $limit = 0, int $offset = 0) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suppose the interface needs to be extended as well? Though I don't see a psalm warning. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adjusted, would need another adjustment in groupfolders again once merged. For potential backports this is a bit more tricky but we may just use an ugly direct call on the private class implementation of a separate method then to avoid the interface adjustment. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The foundational PRs were also backported and there the |
||
$query = $this->queryFromOperator(new SearchComparison(ISearchComparison::COMPARE_EQUAL, 'tagname', $tag), $userId, $limit, $offset); | ||
return $this->search($query); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -150,7 +150,7 @@ public function searchByMime($mimetype) { | |
throw new NotFoundException(); | ||
} | ||
|
||
public function searchByTag($tag, $userId) { | ||
public function searchByTag($tag, $userId, int $limit = 0, int $offset = 0) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That class is a good finding, i shall add searchBySystemTag here also – will be a separate PR. |
||
throw new NotFoundException(); | ||
} | ||
|
||
|
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.
Isn't this this thing again where we slice multiple times and then intersect the results? Does this give proper results? I forgot.
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.
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.
So, it can give too little results. Sometimes even none when some would be expected.
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.
Good point, will see what could be done about that
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.
Since both the
searchBySystemTag
andsearchByTag
end up doing asearch
with their specific search queries anyway. You can instead build a single search query that performs all the filtering in one go.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.
and you can probably also include the filtering for the fileids from
processFilterRulesForFileIDs
in the same query to remove the need for thefindNodesByFileIds
later downThere 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.
Search stuff is not in OCP, though. Would be awesome if it was.
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.
using it in the dav app is fine since it's releases are coupled with core