mirror of
https://github.com/owncloud/ocis
synced 2026-04-25 17:25:21 +02:00
* feat(search): introduce search query package With the increasing complexity of how we organize our resources, the search must also be able to find them using entity properties. The query package provides the necessary functionality to do this. This makes it possible to search for resources via KQL, the microsoft spec is largely covered and can be used for this. In the current state, the legacy query language is still used, in a future update this will be deprecated and KQL will become the standard
19 lines
440 B
Go
19 lines
440 B
Go
// Package kql provides the ability to work with kql queries.
|
|
package kql
|
|
|
|
import (
|
|
"github.com/owncloud/ocis/v2/services/search/pkg/query/ast"
|
|
)
|
|
|
|
// Builder implements kql Builder interface
|
|
type Builder struct{}
|
|
|
|
// Build creates an ast.Ast based on a kql query
|
|
func (b Builder) Build(q string, opts ...Option) (*ast.Ast, error) {
|
|
f, err := Parse("", []byte(q), opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return f.(*ast.Ast), nil
|
|
}
|