mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-21 00:20:50 +00:00
Upgrade bleve from v2.0.6 to v2.3.0 (#18132)
This commit is contained in:
parent
1a4e2bfcd1
commit
25a290e320
70 changed files with 1283 additions and 660 deletions
13
vendor/github.com/blevesearch/bleve/v2/mapping/document.go
generated
vendored
13
vendor/github.com/blevesearch/bleve/v2/mapping/document.go
generated
vendored
|
@ -18,6 +18,7 @@ import (
|
|||
"encoding"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net"
|
||||
"reflect"
|
||||
"time"
|
||||
|
||||
|
@ -76,7 +77,7 @@ func (dm *DocumentMapping) Validate(cache *registry.Cache) error {
|
|||
}
|
||||
}
|
||||
switch field.Type {
|
||||
case "text", "datetime", "number", "boolean", "geopoint":
|
||||
case "text", "datetime", "number", "boolean", "geopoint", "IP":
|
||||
default:
|
||||
return fmt.Errorf("unknown field type: '%s'", field.Type)
|
||||
}
|
||||
|
@ -517,8 +518,14 @@ func (dm *DocumentMapping) processProperty(property interface{}, path []string,
|
|||
case reflect.Map, reflect.Slice:
|
||||
if subDocMapping != nil {
|
||||
for _, fieldMapping := range subDocMapping.Fields {
|
||||
if fieldMapping.Type == "geopoint" {
|
||||
switch fieldMapping.Type {
|
||||
case "geopoint":
|
||||
fieldMapping.processGeoPoint(property, pathString, path, indexes, context)
|
||||
case "IP":
|
||||
ip, ok := property.(net.IP)
|
||||
if ok {
|
||||
fieldMapping.processIP(ip, pathString, path, indexes, context)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -528,7 +535,7 @@ func (dm *DocumentMapping) processProperty(property interface{}, path []string,
|
|||
switch property := property.(type) {
|
||||
case encoding.TextMarshaler:
|
||||
// ONLY process TextMarshaler if there is an explicit mapping
|
||||
// AND all of the fiels are of type text
|
||||
// AND all of the fields are of type text
|
||||
// OTHERWISE process field without TextMarshaler
|
||||
if subDocMapping != nil {
|
||||
allFieldsText := true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue