Cleanup
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Peter Stuifzand 2021-06-20 19:58:18 +02:00
parent db9084e0a1
commit 61e4a84848
Signed by: peter
GPG Key ID: 374322D56E5209E8
2 changed files with 3 additions and 1 deletions

View File

@ -152,10 +152,12 @@ func loadSession(sessionVar string, conn redis.Conn) (session, error) {
if err != nil { if err != nil {
return sess, err return sess, err
} }
err = redis.ScanStruct(data, &sess) err = redis.ScanStruct(data, &sess)
if err != nil { if err != nil {
return sess, err return sess, err
} }
return sess, nil return sess, nil
} }

View File

@ -33,7 +33,6 @@ type indexItem struct {
} }
func addToSearch(item microsub.Item, channel string) error { func addToSearch(item microsub.Item, channel string) error {
// TODO: add channel when indexing
if index != nil { if index != nil {
indexItem := indexItem{item, channel} indexItem := indexItem{item, channel}
err := index.Index(item.ID, indexItem) err := index.Index(item.ID, indexItem)
@ -90,6 +89,7 @@ func querySearch(channel, query string) ([]microsub.Item, error) {
web_1 | (string) (len=16) "author.longitude": (string) "", web_1 | (string) (len=16) "author.longitude": (string) "",
*/ */
// TODO: fetch results from the channel instead of the search result
hits := res.Hits hits := res.Hits
for _, hit := range hits { for _, hit := range hits {
fields := hit.Fields fields := hit.Fields