updated dependencies and moved to new rendering

This commit is contained in:
ston1th 2020-11-12 22:54:50 +01:00
commit 0a55030ae5
467 changed files with 64111 additions and 111050 deletions

View file

@ -18,6 +18,7 @@ import (
"encoding/json"
"fmt"
"reflect"
"sort"
"time"
"github.com/blevesearch/bleve/analysis"
@ -264,6 +265,7 @@ func (h *HighlightRequest) AddField(field string) {
// Score controls the kind of scoring performed
// SearchAfter supports deep paging by providing a minimum sort key
// SearchBefore supports deep paging by providing a maximum sort key
// sortFunc specifies the sort implementation to use for sorting results.
//
// A special field named "*" can be used to return all fields.
type SearchRequest struct {
@ -279,6 +281,8 @@ type SearchRequest struct {
Score string `json:"score,omitempty"`
SearchAfter []string `json:"search_after"`
SearchBefore []string `json:"search_before"`
sortFunc func(sort.Interface)
}
func (r *SearchRequest) Validate() error {
@ -606,3 +610,22 @@ func MemoryNeededForSearchResult(req *SearchRequest) uint64 {
return uint64(estimate)
}
// SetSortFunc sets the sort implementation to use when sorting hits.
//
// SearchRequests can specify a custom sort implementation to meet
// their needs. For instance, by specifying a parallel sort
// that uses all available cores.
func (r *SearchRequest) SetSortFunc(s func(sort.Interface)) {
r.sortFunc = s
}
// SortFunc returns the sort implementation to use when sorting hits.
// Defaults to sort.Sort.
func (r *SearchRequest) SortFunc() func(data sort.Interface) {
if r.sortFunc != nil {
return r.sortFunc
}
return sort.Sort
}