mirror of https://github.com/go-gitea/gitea
Git with a cup of tea, painless self-hosted git service
Mirror for internal git.with.parts use
https://git.with.parts
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
856 B
37 lines
856 B
6 years ago
|
// Copyright 2018 The Gitea Authors. All rights reserved.
|
||
|
// Use of this source code is governed by a MIT-style
|
||
|
// license that can be found in the LICENSE file.
|
||
|
|
||
|
package issues
|
||
|
|
||
|
// IndexerData data stored in the issue indexer
|
||
|
type IndexerData struct {
|
||
|
ID int64
|
||
|
RepoID int64
|
||
|
Title string
|
||
|
Content string
|
||
|
Comments []string
|
||
|
IsDelete bool
|
||
|
IDs []int64
|
||
|
}
|
||
|
|
||
|
// Match represents on search result
|
||
|
type Match struct {
|
||
|
ID int64 `json:"id"`
|
||
|
RepoID int64 `json:"repo_id"`
|
||
|
Score float64 `json:"score"`
|
||
|
}
|
||
|
|
||
|
// SearchResult represents search results
|
||
|
type SearchResult struct {
|
||
|
Hits []Match
|
||
|
}
|
||
|
|
||
|
// Indexer defines an inteface to indexer issues contents
|
||
|
type Indexer interface {
|
||
|
Init() (bool, error)
|
||
|
Index(issue []*IndexerData) error
|
||
|
Delete(ids ...int64) error
|
||
|
Search(kw string, repoID int64, limit, start int) (*SearchResult, error)
|
||
|
}
|