Search: Explain scores (#98316)
This commit is contained in:
@@ -343,6 +343,16 @@ func StandardSearchFields() SearchableDocumentFields {
|
||||
Type: ResourceTableColumnDefinition_INT64,
|
||||
Description: "created timestamp", // date?
|
||||
},
|
||||
{
|
||||
Name: SEARCH_FIELD_EXPLAIN,
|
||||
Type: ResourceTableColumnDefinition_OBJECT,
|
||||
Description: "Explain why this result matches (depends on the engine)",
|
||||
},
|
||||
{
|
||||
Name: SEARCH_FIELD_SCORE,
|
||||
Type: ResourceTableColumnDefinition_DOUBLE,
|
||||
Description: "The search score",
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
panic("failed to initialize standard search fields")
|
||||
|
||||
@@ -123,6 +123,9 @@ func NewTableBuilder(cols []*ResourceTableColumnDefinition) (*TableBuilder, erro
|
||||
}
|
||||
var err error
|
||||
for i, v := range cols {
|
||||
if v == nil {
|
||||
return nil, fmt.Errorf("invalid field definitions")
|
||||
}
|
||||
if table.lookup[v.Name] != nil {
|
||||
table.hasDuplicateNames = true
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user