querqy.model.Query.addClause()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(208)

本文整理了Java中querqy.model.Query.addClause方法的一些代码示例,展示了Query.addClause的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.addClause方法的具体详情如下:
包路径:querqy.model.Query
类名称:Query
方法名:addClause

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);
}

相关文章