feat(beachcomber): search highlights and field projection (quick-261108-pe4)
- Additive: Query.IncludeFields, ExcludeFields and Highlight; left empty, the Typesense request is the same as before. - SearchResult.Hits holds one Hit per id, in step with IDs; SearchPage always fills it. - Snippets are plain-text Segment runs split at private-use highlight tags, never HTML; MaxSnippetsPerArray is applied client-side. - Optional HighlightSearcher capability, checked with SupportsHighlights (true for Typesense, false for null and third-party engines). - README and docs: Highlights sections with the rule that a caller drops the hit of every id failing the SQL re-check before showing a snippet. Targets framework v0.6.4 (additive, no breaking change).
This commit is contained in:
@@ -62,7 +62,8 @@ func init() {
|
||||
}
|
||||
|
||||
// nullEngine is never configured, so sync is skipped before it is called.
|
||||
// Every method is a no-op; SearchIDs and SearchPage return no ids.
|
||||
// Every method is a no-op; SearchIDs and SearchPage return no ids. It does
|
||||
// not implement HighlightSearcher.
|
||||
type nullEngine struct{}
|
||||
|
||||
func (nullEngine) Name() string { return NullEngine }
|
||||
@@ -76,5 +77,5 @@ 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
|
||||
return SearchResult{IDs: []string{}, Hits: []Hit{}}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user