We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aec91df commit 8236d4fCopy full SHA for 8236d4f
cmd/spctl/search.go
@@ -1,6 +1,8 @@
1
package main
2
3
import (
4
+ "fmt"
5
+
6
"github.com/AlecAivazis/survey/v2"
7
"github.com/koltyakov/gosip/api"
8
)
@@ -68,8 +70,14 @@ func getSearchConf(sp *api.SP) (SearchConf, error) {
68
70
return searchConf, err
69
71
}
72
73
+ rows := res.Data().PrimaryQueryResult.RelevantResults.Table.Rows
74
+ if len(rows) == 0 {
75
+ fmt.Println("Warning: no results found for the query")
76
+ return searchConf, nil
77
+ }
78
79
searchProps := []string{}
- for _, prop := range res.Data().PrimaryQueryResult.RelevantResults.Table.Rows[0].Cells {
80
+ for _, prop := range rows[0].Cells {
81
propName := prop.Key
82
searchProps = append(searchProps, propName)
83
0 commit comments