@@ -53,6 +53,7 @@ func generateIssueIndexMapping() (mapping.IndexMapping, error) {
53
53
numericFieldMapping := bleve .NewNumericFieldMapping ()
54
54
numericFieldMapping .Store = false
55
55
numericFieldMapping .IncludeInAll = false
56
+ docMapping .AddFieldMappingsAt ("id" , numericFieldMapping )
56
57
docMapping .AddFieldMappingsAt ("repo_id" , numericFieldMapping )
57
58
58
59
textFieldMapping := bleve .NewTextFieldMapping ()
@@ -161,11 +162,16 @@ func (b *Indexer) Search(ctx context.Context, options *internal.SearchOptions) (
161
162
fuzziness = inner_bleve .GuessFuzzinessByKeyword (options .Keyword )
162
163
}
163
164
164
- queries = append ( queries , bleve . NewDisjunctionQuery ( []query.Query {
165
+ innerQueries := []query.Query {
165
166
inner_bleve .MatchPhraseQuery (options .Keyword , "title" , issueIndexerAnalyzer , fuzziness ),
166
167
inner_bleve .MatchPhraseQuery (options .Keyword , "content" , issueIndexerAnalyzer , fuzziness ),
167
168
inner_bleve .MatchPhraseQuery (options .Keyword , "comments" , issueIndexerAnalyzer , fuzziness ),
168
- }... ))
169
+ }
170
+ if options .IssueID .Has () {
171
+ innerQueries = append (innerQueries , inner_bleve .NumericEqualityQuery (options .IssueID .Value (), "id" ))
172
+ }
173
+
174
+ queries = append (queries , bleve .NewDisjunctionQuery (innerQueries ... ))
169
175
}
170
176
171
177
if len (options .RepoIDs ) > 0 || options .AllPublic {
0 commit comments