1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-24 18:38:28 +00:00

Issue search support elasticsearch (#9428)

* Issue search support elasticsearch

* Fix lint

* Add indexer name on app.ini

* add a warnning on SearchIssuesByKeyword

* improve code
This commit is contained in:
Lunny Xiao
2020-02-13 14:06:17 +08:00
committed by GitHub
parent 17656021f1
commit 5dbf36f356
286 changed files with 57032 additions and 25 deletions

55
vendor/github.com/olivere/elastic/v7/CHANGELOG-7.0.md generated vendored Normal file
View File

@@ -0,0 +1,55 @@
# Changes from 6.0 to 7.0
See [breaking changes](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/breaking-changes-7.0.html).
## SearchHit.Source changed from `*json.RawMessage` to `json.RawMessage`
The `SearchHit` structure changed from
```
// SearchHit is a single hit.
type SearchHit struct {
...
Source *json.RawMessage `json:"_source,omitempty"` // stored document source
...
}
```
to
```
// SearchHit is a single hit.
type SearchHit struct {
...
Source json.RawMessage `json:"_source,omitempty"` // stored document source
...
}
```
As `json.RawMessage` is a `[]byte`, there is no need to specify it
as `*json.RawMessage` as `json.RawMessage` is perfectly ok to represent
a `nil` value.
So when deserializing the search hits, you need to change your code from:
```
for _, hit := range searchResult.Hits.Hits {
var doc Doc
err := json.Unmarshal(*hit.Source, &doc) // notice the * here
if err != nil {
// Deserialization failed
}
}
```
to
```
for _, hit := range searchResult.Hits.Hits {
var doc Doc
err := json.Unmarshal(hit.Source, &doc) // it's missing here
if err != nil {
// Deserialization failed
}
}
```