use of com.xiaomi.linden.thrift.common.LindenDisMaxQuery in project linden by XiaoMi.
the class DisMaxQueryConstructor method construct.
@Override
protected Query construct(LindenQuery lindenQuery, LindenConfig config) throws Exception {
if (!lindenQuery.isSetDisMaxQuery()) {
return null;
}
LindenDisMaxQuery disMaxQuery = lindenQuery.getDisMaxQuery();
DisjunctionMaxQuery disjunctionMaxQuery = new DisjunctionMaxQuery((float) disMaxQuery.getTie());
for (LindenQuery subLindenQuery : disMaxQuery.getQueries()) {
Query query = QueryConstructor.constructQuery(subLindenQuery, config);
if (query != null) {
disjunctionMaxQuery.add(query);
}
}
return disjunctionMaxQuery;
}
Aggregations