use of com.qlangtech.tis.runtime.module.screen.IndexQuery.QueryRequestWrapper in project tis by qlangtech.
the class IndexQueryAction method doGetServerNodes.
/**
* @param context
*/
public void doGetServerNodes(Context context) throws Exception {
AppDomainInfo domain = this.getAppDomain();
if (domain instanceof Nullable) {
throw new IllegalStateException("execute phase must be Collection aware");
}
QueryResutStrategy queryStrategy = QueryIndexServlet.createQueryResutStrategy(domain, new QueryRequestWrapper(getRequest(), context), getResponse(), getDaoContext());
List<ServerJoinGroup> nodes = queryStrategy.queryProcess();
List<PSchemaField> sfields = IndexQuery.getSfields(this.getRequest(), queryStrategy, nodes);
Map<String, Object> props = Maps.newHashMap();
props.put("nodes", queryStrategy.selectCandiate);
props.put("fields", sfields.stream().map((c) -> c.getName()).collect(Collectors.toList()));
this.setBizResult(context, props);
}
use of com.qlangtech.tis.runtime.module.screen.IndexQuery.QueryRequestWrapper in project tis by qlangtech.
the class IndexQueryAction method doQuery.
@Func(value = PermissionConstant.PERMISSION_INDEX_QUERY, sideEffect = false)
public void doQuery(Context context) throws Exception {
List<String> sfields = Lists.newArrayList(this.getRequest().getParameterValues("sfields"));
final String query = StringUtils.defaultIfEmpty((this.getString("q")).replaceAll("\r|\n", StringUtils.EMPTY), "*:*");
Integer shownum = null;
shownum = this.getInt("shownum", 3);
QueryRequestWrapper request = new QueryRequestWrapper(this.getRequest(), context);
QueryRequestContext requestContext = new QueryRequestContext(request);
final String sort = getString("sort");
final String[] fqs = this.getStringArray("fq");
final QueryResutStrategy queryResutStrategy = QueryIndexServlet.createQueryResutStrategy(this.getAppDomain(), request, getResponse(), getDaoContext());
final List<ServerJoinGroup> serverlist = queryResutStrategy.queryProcess();
QueryIndexServlet.execuetQuery(this, this.getAppDomain(), requestContext, this.getDaoContext(), queryResutStrategy, serverlist, query, sort, fqs, shownum, sfields);
}
Aggregations