This commit is contained in:
Alexander Baranov
2020-09-02 20:45:27 +03:00
parent 4fb04abbfe
commit c8e11921ef
3 changed files with 9 additions and 0 deletions

View File

@@ -8,16 +8,19 @@ import (
"net/http"
)
// SearchRequest represents a request structure for search API
type SearchRequest struct {
Documents []string `json:"documents"`
Query string `json:"query"`
}
// SearchResult represents single result from search API
type SearchResult struct {
Document int `json:"document"`
Score float32 `json:"score"`
}
// SearchResponse represents a response structure for search API
type SearchResponse struct {
SearchResults []SearchResult `json:"data"`
}