39 lines
977 B
Go
39 lines
977 B
Go
|
package dto
|
||
|
|
||
|
type MatchLevel string
|
||
|
|
||
|
const (
|
||
|
MatchLevelNone MatchLevel = "none"
|
||
|
MatchLevelFull MatchLevel = "full"
|
||
|
)
|
||
|
|
||
|
type Match struct {
|
||
|
Value string `json:"value"`
|
||
|
MatchLevel MatchLevel `json:"matchLevel"`
|
||
|
FullyHighlighted *bool `json:"fullyHighlighted,omitempty"`
|
||
|
MatchedWords []string `json:"matchedWords"`
|
||
|
}
|
||
|
|
||
|
type SnippetContent struct {
|
||
|
Value string `json:"value"`
|
||
|
MatchLevel MatchLevel `json:"matchLevel"`
|
||
|
}
|
||
|
|
||
|
type SnippetResult struct {
|
||
|
Content SnippetContent `json:"content"`
|
||
|
}
|
||
|
|
||
|
type SearchHit struct {
|
||
|
ObjectID string `json:"objectID"`
|
||
|
MainTitle string `json:"mainTitle"`
|
||
|
PageTitle string `json:"pageTitle"`
|
||
|
Url string `json:"url"`
|
||
|
Breadcrumbs string `json:"breadcrumbs"`
|
||
|
Snippet SnippetResult `json:"_snippetResult"`
|
||
|
Highlight map[string]Match `json:"_highlightResult"`
|
||
|
}
|
||
|
|
||
|
type SearchResponse struct {
|
||
|
Hits []SearchHit `json:"hits"`
|
||
|
}
|