Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
Daniel 2025-12-06 16:31:15 +08:00
parent c1cdb9846c
commit 362f6ffa05
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 10 additions and 0 deletions

View file

@ -42,6 +42,7 @@ type Search struct {
VideoBlock bool `json:"videoBlock"` VideoBlock bool `json:"videoBlock"`
IFrameBlock bool `json:"iframeBlock"` IFrameBlock bool `json:"iframeBlock"`
WidgetBlock bool `json:"widgetBlock"` WidgetBlock bool `json:"widgetBlock"`
Callout bool `json:"callout"`
Limit int `json:"limit"` Limit int `json:"limit"`
CaseSensitive bool `json:"caseSensitive"` CaseSensitive bool `json:"caseSensitive"`
@ -84,6 +85,7 @@ func NewSearch() *Search {
VideoBlock: false, VideoBlock: false,
IFrameBlock: false, IFrameBlock: false,
WidgetBlock: false, WidgetBlock: false,
Callout: false,
Limit: 64, Limit: 64,
CaseSensitive: false, CaseSensitive: false,
@ -227,6 +229,12 @@ func (s *Search) TypeFilter() string {
buf.WriteByte('\'') buf.WriteByte('\'')
buf.WriteString(",") buf.WriteString(",")
} }
if s.Callout {
buf.WriteByte('\'')
buf.WriteString(treenode.TypeAbbr(ast.NodeCallout.String()))
buf.WriteByte('\'')
buf.WriteString(",")
}
ret := buf.String() ret := buf.String()
if "" == ret { if "" == ret {

View file

@ -1433,6 +1433,7 @@ func buildTypeFilter(types map[string]bool) string {
s.VideoBlock = types["videoBlock"] s.VideoBlock = types["videoBlock"]
s.IFrameBlock = types["iframeBlock"] s.IFrameBlock = types["iframeBlock"]
s.WidgetBlock = types["widgetBlock"] s.WidgetBlock = types["widgetBlock"]
s.Callout = types["callout"]
} else { } else {
s.Document = Conf.Search.Document s.Document = Conf.Search.Document
s.Heading = Conf.Search.Heading s.Heading = Conf.Search.Heading
@ -1451,6 +1452,7 @@ func buildTypeFilter(types map[string]bool) string {
s.VideoBlock = Conf.Search.VideoBlock s.VideoBlock = Conf.Search.VideoBlock
s.IFrameBlock = Conf.Search.IFrameBlock s.IFrameBlock = Conf.Search.IFrameBlock
s.WidgetBlock = Conf.Search.WidgetBlock s.WidgetBlock = Conf.Search.WidgetBlock
s.Callout = Conf.Search.Callout
} }
return s.TypeFilter() return s.TypeFilter()
} }