Skip to content

Commit adac3e5

Browse files
add comments
1 parent 8cb243c commit adac3e5

3 files changed

Lines changed: 3 additions & 0 deletions

File tree

index_alias_impl.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,7 @@ func preSearchRequired(ctx context.Context, req *SearchRequest, m mapping.IndexM
629629
return nil, err
630630
}
631631
if fs != nil {
632+
// safe to ignore error from VisitFields, as our func never returns one
632633
fs.VisitFields(func(field string) (bool, error) {
633634
if sm.SynonymSourceForPath(field) != "" {
634635
synonyms = true

registry/nested.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ func (nfc *NestedFieldCache) IntersectsPrefix(fieldPaths search.FieldSet) bool {
120120
func (nfc *NestedFieldCache) prefixMatch(prefix string, fieldPaths search.FieldSet) (common bool, any bool) {
121121
common = true
122122
any = false
123+
// safe to ignore error from VisitFields, as our func never returns one
123124
fieldPaths.VisitFields(func(path string) (bool, error) {
124125
has := strings.HasPrefix(path, prefix)
125126
if has {

search/util.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ type BM25Stats struct {
278278
FieldCardinality map[string]int `json:"field_cardinality"`
279279
}
280280

281+
// FieldSet represents a set of queried fields and related helper methods.
281282
type FieldSet interface {
282283
// AddField adds a field to the set.
283284
AddField(field string)

0 commit comments

Comments
 (0)