diff options
author | bit <j@mailb.org> | 2017-02-24 02:24:58 +0100 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-02-24 09:24:58 +0800 |
commit | 490d3771f7b6a6947d54dbf1f761bfec5dba0709 (patch) | |
tree | e86be9b13eac023879b614520af64005ce0d63c6 /models/issue_indexer.go | |
parent | d077fd084a3cc8d96ba80d8fcf950b21523644b2 (diff) | |
download | gitea-490d3771f7b6a6947d54dbf1f761bfec5dba0709.tar.gz gitea-490d3771f7b6a6947d54dbf1f761bfec5dba0709.zip |
s/fields/terms (#1031)
use terms instead of fields as variable name to avoid confusion: NewPhraseQuery(terms []string, field string)
Diffstat (limited to 'models/issue_indexer.go')
-rw-r--r-- | models/issue_indexer.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/models/issue_indexer.go b/models/issue_indexer.go index bbaf0e64bc..49875fcf7f 100644 --- a/models/issue_indexer.go +++ b/models/issue_indexer.go @@ -46,12 +46,12 @@ func numericQuery(value int64, field string) *query.NumericRangeQuery { // SearchIssuesByKeyword searches for issues by given conditions. // Returns the matching issue IDs func SearchIssuesByKeyword(repoID int64, keyword string) ([]int64, error) { - fields := strings.Fields(strings.ToLower(keyword)) + terms := strings.Fields(strings.ToLower(keyword)) indexerQuery := bleve.NewConjunctionQuery( numericQuery(repoID, "RepoID"), bleve.NewDisjunctionQuery( - bleve.NewPhraseQuery(fields, "Title"), - bleve.NewPhraseQuery(fields, "Content"), + bleve.NewPhraseQuery(terms, "Title"), + bleve.NewPhraseQuery(terms, "Content"), )) search := bleve.NewSearchRequestOptions(indexerQuery, 2147483647, 0, false) search.Fields = []string{"ID"} |