|
|
@ -30,7 +30,6 @@ import (
|
|
|
|
"strings"
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/Masterminds/semver"
|
|
|
|
"github.com/Masterminds/semver"
|
|
|
|
|
|
|
|
|
|
|
|
"k8s.io/helm/pkg/repo"
|
|
|
|
"k8s.io/helm/pkg/repo"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
@ -147,6 +146,8 @@ func (i *Index) SearchLiteral(term string, threshold int) []*Result {
|
|
|
|
term = strings.ToLower(term)
|
|
|
|
term = strings.ToLower(term)
|
|
|
|
buf := []*Result{}
|
|
|
|
buf := []*Result{}
|
|
|
|
for k, v := range i.lines {
|
|
|
|
for k, v := range i.lines {
|
|
|
|
|
|
|
|
k = strings.ToLower(k)
|
|
|
|
|
|
|
|
v = strings.ToLower(v)
|
|
|
|
res := strings.Index(v, term)
|
|
|
|
res := strings.Index(v, term)
|
|
|
|
if score := i.calcScore(res, v); res != -1 && score < threshold {
|
|
|
|
if score := i.calcScore(res, v); res != -1 && score < threshold {
|
|
|
|
parts := strings.Split(k, verSep) // Remove version, if it is there.
|
|
|
|
parts := strings.Split(k, verSep) // Remove version, if it is there.
|
|
|
@ -231,5 +232,5 @@ func (s scoreSorter) Less(a, b int) bool {
|
|
|
|
func indstr(name string, ref *repo.ChartVersion) string {
|
|
|
|
func indstr(name string, ref *repo.ChartVersion) string {
|
|
|
|
i := ref.Name + sep + name + "/" + ref.Name + sep +
|
|
|
|
i := ref.Name + sep + name + "/" + ref.Name + sep +
|
|
|
|
ref.Description + sep + strings.Join(ref.Keywords, " ")
|
|
|
|
ref.Description + sep + strings.Join(ref.Keywords, " ")
|
|
|
|
return strings.ToLower(i)
|
|
|
|
return i
|
|
|
|
}
|
|
|
|
}
|
|
|
|