|
|
@@ -46,13 +46,13 @@ func (e *EntryQueryBuilder) WithoutContent() *EntryQueryBuilder {
|
|
|
func (e *EntryQueryBuilder) WithSearchQuery(query string) *EntryQueryBuilder {
|
|
|
if query != "" {
|
|
|
nArgs := len(e.args) + 1
|
|
|
- e.conditions = append(e.conditions, fmt.Sprintf("e.document_vectors @@ plainto_tsquery($%d)", nArgs))
|
|
|
+ e.conditions = append(e.conditions, fmt.Sprintf("e.document_vectors @@ websearch_to_tsquery($%d)", nArgs))
|
|
|
e.args = append(e.args, query)
|
|
|
|
|
|
// 0.0000001 = 0.1 / (seconds_in_a_day)
|
|
|
|
|
|
e.sortExpressions = append(e.sortExpressions,
|
|
|
- fmt.Sprintf("ts_rank(document_vectors, plainto_tsquery($%d)) - extract (epoch from now() - published_at)::float * 0.0000001 DESC", nArgs),
|
|
|
+ fmt.Sprintf("ts_rank(document_vectors, websearch_to_tsquery($%d)) - extract (epoch from now() - published_at)::float * 0.0000001 DESC", nArgs),
|
|
|
)
|
|
|
}
|
|
|
return e
|