Search in sources :

Example 1 with ResultTransformer

use of com.rbmhtechnology.vind.demo.step5.guardian.ResultTransformer in project vind by RBMHTechnology.

the class SearchApplication method main.

public static void main(String[] args) {
    try (SearchService search = new SearchService(args[0])) {
        get("/index", (req, res) -> search.index());
        Spark.get("/search", (req, res) -> search.search(req.queryParams("q"), req.queryParamsValues("filter")), new ResultTransformer());
        get("/news", (req, res) -> search.search(req.queryParams("q"), Integer.parseInt(StringUtils.defaultIfBlank(req.queryParams("p"), "1")), SearchService.Sort.pares(req.queryParams("sort"))), new ResultTransformer());
        get("/suggest", (req, res) -> search.suggest(req.queryParams("q")), new ResultTransformer());
        // of the core is deleted.
        while (true) {
        }
    }
}
Also used : SearchService(com.rbmhtechnology.vind.demo.step5.service.SearchService) ResultTransformer(com.rbmhtechnology.vind.demo.step5.guardian.ResultTransformer)

Aggregations

ResultTransformer (com.rbmhtechnology.vind.demo.step5.guardian.ResultTransformer)1 SearchService (com.rbmhtechnology.vind.demo.step5.service.SearchService)1