feat(12-01): report the search engine's found count and field weights

- optional beachcomber.PageSearcher returns a page of candidate ids plus
  the engine's found count; beachcomber.SearchPage falls back to
  SearchIDs for engines without it, so Engine is unchanged
- Query.QueryByWeights is sent to Typesense as query_by_weights; a
  mismatched weight list or a page above typesense.MaxPerPage (250) is
  refused before any request
This commit is contained in:
Jakub Zych
2026-10-02 11:37:01 +02:00
parent e06e0cc8bf
commit 3ae49bb6f4
7 changed files with 253 additions and 17 deletions

View File

@@ -62,7 +62,7 @@ func init() {
}
// nullEngine is never configured, so sync is skipped before it is called.
// Every method is a no-op; SearchIDs returns an empty list.
// Every method is a no-op; SearchIDs and SearchPage return no ids.
type nullEngine struct{}
func (nullEngine) Name() string { return NullEngine }
@@ -75,3 +75,6 @@ func (nullEngine) Flush(context.Context, string) error { return nil }
func (nullEngine) SearchIDs(context.Context, string, Query) ([]string, error) {
return []string{}, nil
}
func (nullEngine) SearchPage(context.Context, string, Query) (SearchResult, error) {
return SearchResult{IDs: []string{}}, nil
}