1:- module(bc_api_search, []).

Search API handlers */

    5:- use_module(library(arouter)).    6:- use_module(library(http/http_wrapper)).    7:- use_module(library(http/http_parameters)).    8
    9:- use_module(bc_api_io).   10:- use_module(bc_search).   11
   12:- route_get(api/search/Type, search(Type)).   13
   14search(Type):-
   15    http_current_request(Request),
   16    http_parameters(Request, [
   17        q(Query, [atom, default('')])]),
   18    bc_search(Type, Query, Results),
   19    bc_reply_success(Results)