From be74ef76b30e7ad9fc74294c8e94ff1f40e87b4e Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Thu, 23 May 2024 15:33:11 +0200 Subject: Discovery: Improve search using levenshtein distance and sorting --- types/discovery/discovery.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'types') diff --git a/types/discovery/discovery.go b/types/discovery/discovery.go index 4d92766..f1f8ed6 100644 --- a/types/discovery/discovery.go +++ b/types/discovery/discovery.go @@ -17,6 +17,8 @@ type Organization struct { DisplayName MapOrString `json:"display_name,omitempty"` // OrgID is the organization ID for the server OrgID string `json:"org_id"` + // score is the score internally used for sorting + Score int `json:"-"` } // Servers is the type that defines the upstream discovery format for the list of servers @@ -36,6 +38,8 @@ type Server struct { Type string `json:"server_type"` // CountryCode is the country code of the server if Type is "secure_internet", e.g. nl CountryCode string `json:"country_code"` + // score is the score internally used for sorting + Score int `json:"-"` } // MapOrString is a custom type as the upstream discovery format is a map or a value. -- cgit v1.2.3