Skip to content

Commit

Permalink
feat:enhance keyword search capability
Browse files Browse the repository at this point in the history
  • Loading branch information
vimiix committed Dec 18, 2023
1 parent 9a77945 commit eb5f3cb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ssx/ssx.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (s *SSX) searchEntry(keyword string) (*entry.Entry, error) {
}
var candidates []*entry.Entry
for _, e := range es {
if strings.Contains(e.Host, keyword) ||
if strings.Contains(e.String(), keyword) ||
strings.Contains(strings.Join(e.Tags, " "), keyword) {
candidates = append(candidates, e)
}
Expand All @@ -213,6 +213,12 @@ func (s *SSX) searchEntry(keyword string) (*entry.Entry, error) {
if err = e.Tidy(); err != nil {
return nil, err
}
for _, exist := range es {
if exist.String() == e.String() {
lg.Debug("found exist entry: %s", exist.String())
return exist, nil
}
}
return e, nil
}

Expand Down

0 comments on commit eb5f3cb

Please sign in to comment.