0
0
Fork 0

also print out the requested stored fields

This commit is contained in:
Marty Schoch 2015-01-16 13:35:27 -05:00
parent 09fe749913
commit 8afbd485f9
1 changed files with 6 additions and 0 deletions

View File

@ -259,6 +259,12 @@ func (sr *SearchResult) String() string {
rv += fmt.Sprintf("\t\t%s\n", fragment)
}
}
for otherFieldName, otherFieldValue := range hit.Fields {
if _, ok := hit.Fragments[otherFieldName]; !ok {
rv += fmt.Sprintf("\t%s\n", otherFieldName)
rv += fmt.Sprintf("\t\t%s\n", otherFieldValue)
}
}
}
} else {
rv = fmt.Sprintf("%d matches, took %s\n", sr.Total, sr.Took)