public static Inflector<ContainerRequestContext, Response> searchHandler(final App app, final String type) {
		return new Inflector<ContainerRequestContext, Response>() {
			public Response apply(ContainerRequestContext ctx) {
				App app1 = (app == null) ? getPrincipalApp() : app;
				MultivaluedMap<String, String> params = ctx.getUriInfo().getQueryParameters();
				String query = params.getFirst("q");
				if (!StringUtils.isBlank(query) && !getSearch().isValidQueryString(query)) {
					return getStatusResponse(Response.Status.BAD_REQUEST, "Invalid query string syntax.");
				}
				String queryType = pathParam("querytype", ctx);
				if (StringUtils.isBlank(queryType)) {
					queryType = "default";
				}
				return Response.ok(RestUtils.buildQueryAndSearch(app1, queryType, params, type)).build();
			}
		};
	}
public static Inflector < ContainerRequestContext , Response > searchHandler ( final App app , final String type ) { return new Inflector < ContainerRequestContext , Response > ( ) { public Response apply ( ContainerRequestContext ctx ) { App app1 = ( app == null ) ? getPrincipalApp ( ) : app ; MultivaluedMap < String , String > params = ctx . getUriInfo ( ) . getQueryParameters ( ) ; String query = params . getFirst ( "q" ) ; if ( ! StringUtils . isBlank ( query ) && ! getSearch ( ) . isValidQueryString ( query ) ) { return getStatusResponse ( Response . Status . BAD_REQUEST , "Invalid query string syntax." ) ; } String queryType = pathParam ( "querytype" , ctx ) ; if ( StringUtils . isBlank ( queryType ) ) { queryType = "default" ; } return Response . ok ( RestUtils . buildQueryAndSearch ( app1 , queryType , params , type ) ) . build ( ) ; } } ; }
@param app {@link App}
@param type a type
@return response