February 2018
Intermediate to advanced
246 pages
6h 3m
English
Here's the feeder.go script to check if /api/index accepts index terms:
package main import ( "bytes" "encoding/json" "io/ioutil" "log" "net/http" ) type tPayload struct { Token string 'json:"token"' Title string 'json:"title"' DocID string 'json:"doc_id"' LIndex int 'json:"line_index"' Index int 'json:"token_index"' } type msgS struct { Code int 'json:"code"' Msg string 'json:"msg"' } func main() { // Searching for "apple" should return Book 1 at the top of search results. // Searching for "cake" should return Book 3 at the top. for bookX, terms := range map[string][]string{ "Book 1": []string{"apple", "apple", "cat", "zebra"}, "Book 2": []string{"banana", "cake", "zebra"}, "Book 3": []string{"apple", "cake", ...Read now
Unlock full access