mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-24 05:51:33 -05:00
* Add audio facet to search protobuf message * Add audio metadata to search index * Return audio facet from search if available * Store audio metadata in arbitrary metadata * Add audio facet to driveItems listings * Make tests coding style more consistent * Fix tests * Add changelog * Make valueToString code more defensive * Log status code as well
30 lines
603 B
Go
30 lines
603 B
Go
package content
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/bbalet/stopwords"
|
|
libregraph "github.com/owncloud/libre-graph-api-go"
|
|
)
|
|
|
|
func init() {
|
|
stopwords.OverwriteWordSegmenter(`[^ ]+`)
|
|
}
|
|
|
|
// Document wraps all resource meta fields,
|
|
// it is used as a content extraction result.
|
|
type Document struct {
|
|
Title string
|
|
Name string
|
|
Content string
|
|
Size uint64
|
|
Mtime string
|
|
MimeType string
|
|
Tags []string
|
|
Audio *libregraph.Audio `json:"audio,omitempty"`
|
|
}
|
|
|
|
func CleanString(content, langCode string) string {
|
|
return strings.TrimSpace(stopwords.CleanString(content, langCode, true))
|
|
}
|