Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue search support elasticsearch #9428

Merged
merged 6 commits into from
Feb 13, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
improve code
  • Loading branch information
lunny committed Feb 12, 2020
commit e41403b1c1c59e314ed5bc3f3896de4df6f783dd
4 changes: 2 additions & 2 deletions docs/content/doc/advanced/config-cheat-sheet.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,10 @@ relation to port exhaustion.

## Indexer (`indexer`)

- `ISSUE_INDEXER_TYPE`: **bleve**: Issue indexer type, currently support: bleve, db or elasticsearch, if it's db, below issue indexer item will be invalid.
- `ISSUE_INDEXER_TYPE`: **bleve**: Issue indexer type, currently supported: `bleve`, `db` or `elasticsearch`.
- `ISSUE_INDEXER_CONN_STR`: ****: Issue indexer connection string, available when ISSUE_INDEXER_TYPE is elasticsearch. i.e. https://elastic:changeme@localhost:9200
lunny marked this conversation as resolved.
Show resolved Hide resolved
lunny marked this conversation as resolved.
Show resolved Hide resolved
- `ISSUE_INDEXER_NAME`: **gitea_issues**: Issue indexer name, available when ISSUE_INDEXER_TYPE is elasticsearch
- `ISSUE_INDEXER_PATH`: **indexers/issues.bleve**: Index file used for issue search.
- `ISSUE_INDEXER_PATH`: **indexers/issues.bleve**: Index file used for issue search; available when ISSUE_INDEXER_TYPE is bleve and elasticsearch.
lunny marked this conversation as resolved.
Show resolved Hide resolved
- The next 4 configuration values are deprecated and should be set in `queue.issue_indexer` however are kept for backwards compatibility:
- `ISSUE_INDEXER_QUEUE_TYPE`: **levelqueue**: Issue indexer queue, currently supports:`channel`, `levelqueue`, `redis`.
- `ISSUE_INDEXER_QUEUE_DIR`: **indexers/issues.queue**: When `ISSUE_INDEXER_QUEUE_TYPE` is `levelqueue`, this will be the queue will be saved path.
Expand Down
2 changes: 1 addition & 1 deletion modules/indexer/issues/bleve.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func NewBleveIndexer(indexDir string) *BleveIndexer {
}
}

// Init will initial the indexer
// Init will initialize the indexer
func (b *BleveIndexer) Init() (bool, error) {
var err error
b.indexer, err = openIndexer(b.indexDir, issueIndexerLatestVersion)
Expand Down
3 changes: 1 addition & 2 deletions modules/indexer/issues/elastic_search.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const (
}`
)

// Init will initial the indexer
// Init will initialize the indexer
func (b *ElasticSearchIndexer) Init() (bool, error) {
ctx := context.Background()
exists, err := b.client.IndexExists(b.indexerName).Do(ctx)
Expand Down Expand Up @@ -142,7 +142,6 @@ func (b *ElasticSearchIndexer) Index(issues []*IndexerData) error {
reqs = append(reqs,
elastic.NewBulkIndexRequest().
Index(b.indexerName).
//Type(b.typeName).
Id(fmt.Sprintf("%d", issue.ID)).
Doc(map[string]interface{}{
lunny marked this conversation as resolved.
Show resolved Hide resolved
"id": issue.ID,
Expand Down