Skip to content

Commit

Permalink
add search mimetype filter
Browse files Browse the repository at this point in the history
  • Loading branch information
2403905 committed Nov 8, 2023
1 parent 4b08a8b commit acbd11b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 12 deletions.
15 changes: 15 additions & 0 deletions changelog/unreleased/add-file-type-filter-chip.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Enhancement: Add search mimetype filter

Add filter MimeType filter shortcuts to search for specific document types.
For example, a search query MimeType:documents will search for files with the following mimetypes:

application/msword
MimeType:application/vnd.openxmlformats-officedocument.wordprocessingml.document
MimeType:application/vnd.oasis.opendocument.text
MimeType:text/plain
MimeType:text/markdown
MimeType:application/rtf
MimeType:application/vnd.apple.pages

https://github.com/cs3org/reva/pull/4320
https://github.com/owncloud/ocis/issues/7432
24 changes: 12 additions & 12 deletions internal/http/services/owncloud/ocs/data/capabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,26 +69,26 @@ type CapabilitiesSearch struct {

// 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"`
Name *CapabilitiesSearchProperty `json:"name" xml:"name" mapstructure:"name"`
Mtime *CapabilitiesSearchPropertyExtended `json:"mtime" xml:"mtime" mapstructure:"mtime"`
Size *CapabilitiesSearchProperty `json:"size" xml:"size" mapstructure:"size"`
Mimetype *CapabilitiesSearchPropertyExtended `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"`
}

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

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

0 comments on commit acbd11b

Please sign in to comment.