Skip to content

Commit b9ac80c

Browse files
committed
Suggestion builders don't have a type
1 parent d6b46f4 commit b9ac80c

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

suggest.go

-21
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,13 @@ type SuggestService struct {
2121
routing string
2222
preference string
2323
indices []string
24-
types []string
2524
suggesters []Suggester
2625
}
2726

2827
func NewSuggestService(client *Client) *SuggestService {
2928
builder := &SuggestService{
3029
client: client,
3130
indices: make([]string, 0),
32-
types: make([]string, 0),
3331
suggesters: make([]Suggester, 0),
3432
}
3533
return builder
@@ -45,16 +43,6 @@ func (s *SuggestService) Indices(indices ...string) *SuggestService {
4543
return s
4644
}
4745

48-
func (s *SuggestService) Type(typ string) *SuggestService {
49-
s.types = append(s.types, typ)
50-
return s
51-
}
52-
53-
func (s *SuggestService) Types(types ...string) *SuggestService {
54-
s.types = append(s.types, types...)
55-
return s
56-
}
57-
5846
func (s *SuggestService) Pretty(pretty bool) *SuggestService {
5947
s.pretty = pretty
6048
return s
@@ -91,15 +79,6 @@ func (s *SuggestService) Do() (SuggestResult, error) {
9179
}
9280
urls += strings.Join(indexPart, ",")
9381

94-
// Types part
95-
typesPart := make([]string, 0)
96-
for _, typ := range s.types {
97-
typesPart = append(typesPart, cleanPathString(typ))
98-
}
99-
if len(typesPart) > 0 {
100-
urls += "/" + strings.Join(typesPart, ",")
101-
}
102-
10382
// Suggest
10483
urls += "/_suggest"
10584

0 commit comments

Comments
 (0)