feat: Add IAccountScopedSearchProvider - #64491
CarlSchwan wants to merge 6 commits into
Conversation
789c118 to
e9d774b
Compare
313d1c7 to
4c0220e
Compare
| $fields = [ | ||
| ['id' => 'name', 'title' => $this->l10n->t('Name'), 'type' => 'text', 'default' => ''], | ||
| ['id' => 'path', 'title' => $this->l10n->t('Path'), 'type' => 'text', 'default' => ''], | ||
| ['id' => 'mimetype', 'title' => $this->l10n->t('File type'), 'type' => 'text', 'default' => ''], | ||
| ['id' => 'size', 'title' => $this->l10n->t('Size'), 'type' => 'number', 'default' => 0], | ||
| ['id' => 'modified', 'title' => $this->l10n->t('Modified'), 'type' => 'number', 'default' => 0], | ||
| ['id' => 'created', 'title' => $this->l10n->t('Created'), 'type' => 'number', 'default' => 0], | ||
| ]; |
There was a problem hiding this comment.
Could we reuse the data from FileSearchBackend::getPropertyDefinitionsForScope here somehow? or create a shared source of truth somewhere else
|
(only looked at part of the code so far, non-existence of comments on code should not be takes as a non-existence of (possible) issues) |
4c0220e to
1ba9b22
Compare
Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: Carl Schwan <carl@carlschwan.eu>
bfccfe0 to
c9a7b00
Compare
Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: Carl Schwan <carl@carlschwan.eu>
c9a7b00 to
aa5f9aa
Compare
| default => array_reduce( | ||
| $operator->getArguments(), | ||
| static fn (bool $carry, ISearchOperator $child): bool => $carry && self::node($child, $values), | ||
| true, | ||
| ), |
| ISearchBinaryOperator::OPERATOR_OR => array_reduce( | ||
| $operator->getArguments(), | ||
| static fn (bool $carry, ISearchOperator $child): bool => $carry || self::node($child, $values), | ||
| false, | ||
| ), |
| 'path', | ||
| is_array($value) | ||
| ? array_map(static fn (mixed $path): string => 'files/' . ltrim((string)$path, '/'), $value) | ||
| : 'files/' . ltrim((string)$value, '/'), |
There was a problem hiding this comment.
this will break for groupfolders/external storages
| return $value; | ||
| } | ||
|
|
||
| $term = preg_replace('/(?<!\\\\)[%_]/', ' ', $value) ?? $value; |
| */ | ||
| private function fileIdsToComparison(array $ids): ISearchOperator { | ||
| if ($ids === []) { | ||
| return new SearchComparison(ISearchComparison::COMPARE_EQUAL, 'fileid', -1); |
There was a problem hiding this comment.
I think an empty "and" search operator has the expected effect of matching nothing (but you'll need to double check that). But it should be handled better by later query optimizations/manipulation steps than doing an "invalid" comparison like this.
| * | ||
| * @experimental 36.0.0 | ||
| */ | ||
| final class SearchPropertyDefinition { |
There was a problem hiding this comment.
This is a SearchDAV\Backend\SearchPropertyDefinition with an added title field right?
Would it make sense to inherit that instead or otherwise reuse bits
Summary
See
occ search:providersandocc search:queryfor using thisTODO
Checklist
3. to review, feature component)stable32)AI (if applicable)