本文整理了Java中querqy.model.Query.addClause
方法的一些代码示例,展示了Query.addClause
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.addClause
方法的具体详情如下:
包路径:querqy.model.Query
类名称:Query
方法名:addClause
暂无
代码示例来源:origin: renekrie/querqy
@Override
public Query clone(final BooleanParent newParent, final Occur occur, final boolean generated) {
final Query q = new Query(generated);
for (final BooleanClause clause : clauses) {
q.addClause(clause.clone(q, generated));
}
return q;
}
代码示例来源:origin: renekrie/querqy
@Override
public Node visit(final Query query) {
Query clone = new Query();
newParentStack.add(clone);
for (final BooleanClause clause : query.getClauses()) {
clone.addClause((BooleanClause) clause.accept(this));
}
newParentStack.removeLast();
return clone;
}
代码示例来源:origin: renekrie/querqy
Query termsToQuery(String termsQuery) {
Query query = new Query();
for (String t : termsQuery.split("\\s+")) {
if (t.length() > 0) {
DisjunctionMaxQuery dmq = new DisjunctionMaxQuery(query, Occur.SHOULD, false);
query.addClause(dmq);
Term term = new Term(dmq, t);
dmq.addClause(term);
}
}
return query;
}
代码示例来源:origin: renekrie/querqy
DisjunctionMaxQuery dmq = new DisjunctionMaxQuery(
query, occur, false);
query.addClause(dmq);
Term term = new Term(dmq, input.substring(start, idx));
dmq.addClause(term);
query.addClause(dmq);
Term term = new Term(dmq, occur == Occur.MUST ? "+"
: "-");
DisjunctionMaxQuery dmq = new DisjunctionMaxQuery(query, occur,
false);
query.addClause(dmq);
Term term = new Term(dmq, input.substring(start));
dmq.addClause(term);
DisjunctionMaxQuery dmq = new DisjunctionMaxQuery(
query, Occur.SHOULD, false);
query.addClause(dmq);
Term term = new Term(dmq, occur == Occur.MUST ? "+"
: "-");
代码示例来源:origin: renekrie/querqy
private void addTerm(Query query, String field, String value) {
DisjunctionMaxQuery dmq = new DisjunctionMaxQuery(query, Clause.Occur.SHOULD, true);
query.addClause(dmq);
Term term = new Term(dmq, field, value);
dmq.addClause(term);
}
代码示例来源:origin: renekrie/querqy
query.addClause(dmq);
DisjunctionMaxQuery dmq = new DisjunctionMaxQuery(query, Occur.SHOULD, false);
dmq.addClause(new Term(dmq, input));
query.addClause(dmq);
代码示例来源:origin: renekrie/querqy
private void addTerm(Query query, String field, String value, boolean isGenerated) {
DisjunctionMaxQuery dmq = new DisjunctionMaxQuery(query, Clause.Occur.SHOULD, true);
query.addClause(dmq);
Term term = new Term(dmq, field, value, isGenerated);
dmq.addClause(term);
}
内容来源于网络,如有侵权,请联系作者删除!