1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-06-27 16:36:00 +00:00

Add search form

This commit is contained in:
Frédéric Guillot 2018-07-04 22:05:19 -07:00
parent af15412954
commit 6d0dc451e4
20 changed files with 383 additions and 49 deletions

View file

@ -23,6 +23,14 @@ type EntryPaginationBuilder struct {
direction string
}
// WithSearchQuery adds full-text search query to the condition.
func (e *EntryPaginationBuilder) WithSearchQuery(query string) {
if query != "" {
e.conditions = append(e.conditions, fmt.Sprintf("e.document_vectors @@ plainto_tsquery($%d)", len(e.args)+1))
e.args = append(e.args, query)
}
}
// WithStarred adds starred to the condition.
func (e *EntryPaginationBuilder) WithStarred() {
e.conditions = append(e.conditions, "e.starred is true")