go version go1.21.1 linux/amd64
go run main.gosudo docker build -t ocr-search .
sudo docker run -dp 0.0.0.0:8080:8080 ocr-search/health (GET)
/search/{method} (POST)
method: [exact,fuzzy,advanced (not implemented)]
query_string:unicode string, the query to search fortopk: return the topkresults
status:int, HTTP codemessage:string, Error message if errordata:video:string, the name of the videoframe_name:string, the frame image namescore:int, the score of the keyframe
Search for vietnam with fuzzy method and return 4 results:
Request: http://localhost:8080/search/fuzzy
Body:
{
"query_text": "vietnam",
"topk": 4
}Response:
{
"data":
[
{"video":"L23_V018","frame_name":"099.jpg","score":7},
{"video":"L12_V014","frame_name":"0314.jpg","score":7},
{"video":"L06_V022","frame_name":"0074.jpg","score":7},
{"video":"L22_V027","frame_name":"049.jpg","score":7}
],
"message":"OK",
"status":200
}