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

enhancement: add search capability #4271

Merged
merged 1 commit into from Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -4,4 +4,4 @@ We have added the ability to hide shares through the
ocs/v2.php/apps/files_sharing/api/v1/shares/pending/ endpoint
by appending a POST-Variable called hide which can be true or false.

https://github.com/cs3org/reva/pull/4194/files
https://github.com/cs3org/reva/pull/4194
5 changes: 5 additions & 0 deletions changelog/unreleased/add-search-capability.md
@@ -0,0 +1,5 @@
Enhancement: Add search capability

We have added the ability to define search specific capabilities.

https://github.com/cs3org/reva/pull/4271
31 changes: 30 additions & 1 deletion internal/http/services/owncloud/ocs/data/capabilities.go
Expand Up @@ -58,8 +58,37 @@ type Capabilities struct {
Spaces *Spaces `json:"spaces,omitempty" xml:"spaces,omitempty" mapstructure:"spaces"`
Graph *CapabilitiesGraph `json:"graph,omitempty" xml:"graph,omitempty" mapstructure:"graph"`
PasswordPolicy *CapabilitiesPasswordPolicy `json:"password_policy,omitempty" xml:"password_policy,omitempty" mapstructure:"password_policy"`
Search *CapabilitiesSearch `json:"search,omitempty" xml:"search,omitempty" mapstructure:"search"`
Notifications *CapabilitiesNotifications `json:"notifications,omitempty" xml:"notifications,omitempty"`
}

// CapabilitiesSearch holds the search capabilities
type CapabilitiesSearch struct {
Property *CapabilitiesSearchProperties `json:"property" xml:"property" mapstructure:"property"`
}

// CapabilitiesSearchProperties holds the search property capabilities
type CapabilitiesSearchProperties struct {
Name *CapabilitiesSearchProperty `json:"name" xml:"name" mapstructure:"name"`
Mtime *CapabilitiesSearchPropertyMtime `json:"mtime" xml:"mtime" mapstructure:"mtime"`
Size *CapabilitiesSearchProperty `json:"size" xml:"size" mapstructure:"size"`
Mimetype *CapabilitiesSearchProperty `json:"mimetype" xml:"mimetype" mapstructure:"mimetype"`
Type *CapabilitiesSearchProperty `json:"type" xml:"type" mapstructure:"type"`
Tag *CapabilitiesSearchProperty `json:"tag" xml:"tag" mapstructure:"tag"`
Tags *CapabilitiesSearchProperty `json:"tags" xml:"tags" mapstructure:"tags"`
Content *CapabilitiesSearchProperty `json:"content" xml:"content" mapstructure:"content"`
Scope *CapabilitiesSearchProperty `json:"scope" xml:"scope" mapstructure:"scope"`
}

// CapabilitiesSearchProperty represents the default search property
type CapabilitiesSearchProperty struct {
Enabled bool `json:"enabled" xml:"enabled" mapstructure:"enabled"`
}

Notifications *CapabilitiesNotifications `json:"notifications,omitempty" xml:"notifications,omitempty"`
// CapabilitiesSearchPropertyMtime represents the mtime search property
type CapabilitiesSearchPropertyMtime struct {
CapabilitiesSearchProperty
Keywords []string `json:"keywords" xml:"keywords" mapstructure:"keywords"`
}

// Spaces lets a service configure its advertised options related to Storage Spaces.
Expand Down