fix: hide suspended account
This commit is contained in:
@@ -82,13 +82,18 @@ const searchStopwordsSet = "common"
|
||||
|
||||
// searchResultItem represents a single search result in the API response.
|
||||
type searchResultItem struct {
|
||||
Collection string `json:"collection"`
|
||||
Slug string `json:"slug,omitempty"`
|
||||
Title string `json:"title"`
|
||||
Snippet string `json:"snippet"`
|
||||
URL string `json:"url"`
|
||||
Meta map[string]interface{} `json:"meta,omitempty"`
|
||||
score int64 // internal, not serialized
|
||||
Collection string `json:"collection"`
|
||||
// DocID is the underlying Mongo _id hex — the indexer uses it as the
|
||||
// Typesense document id. Surfaced so the admin panel can pin a specific
|
||||
// item as the Vāṇī of the Day; it identifies public content, not anything
|
||||
// private.
|
||||
DocID string `json:"doc_id,omitempty"`
|
||||
Slug string `json:"slug,omitempty"`
|
||||
Title string `json:"title"`
|
||||
Snippet string `json:"snippet"`
|
||||
URL string `json:"url"`
|
||||
Meta map[string]interface{} `json:"meta,omitempty"`
|
||||
score int64 // internal, not serialized
|
||||
}
|
||||
|
||||
// searchResponse is the shape of the data field in the API response.
|
||||
@@ -349,6 +354,7 @@ func hitToResultItem(collection string, hit *api.SearchResultHit) searchResultIt
|
||||
|
||||
item := searchResultItem{
|
||||
Collection: collection,
|
||||
DocID: getStringField(doc, "id"),
|
||||
URL: getStringField(doc, "url"),
|
||||
score: score,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user