Skip to content

Commit

Permalink
Include freq/norm if location information is asked for
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavdangeti committed Apr 8, 2019
1 parent 45782f2 commit 409d4e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index/scorch/segment/zap/posting.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func (p *PostingsList) iterator(includeFreq, includeNorm, includeLocs bool,
}

rv.postings = p
rv.includeFreqNorm = includeFreq || includeNorm
rv.includeFreqNorm = includeFreq || includeNorm || includeLocs
rv.includeLocs = includeLocs

if p.normBits1Hit != 0 {
Expand Down
2 changes: 1 addition & 1 deletion search/searcher/search_term.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func NewTermSearcher(indexReader index.IndexReader, term string, field string, b
}

func NewTermSearcherBytes(indexReader index.IndexReader, term []byte, field string, boost float64, options search.SearcherOptions) (*TermSearcher, error) {
needFreqNorm := options.IncludeTermVectors || options.Score != "none"
needFreqNorm := options.Score != "none"
reader, err := indexReader.TermFieldReader(term, field, needFreqNorm, needFreqNorm, options.IncludeTermVectors)
if err != nil {
return nil, err
Expand Down

0 comments on commit 409d4e4

Please sign in to comment.