Beispiel #1
0
  public CObjList getPushesToConnect() {
    BooleanQuery bq = new BooleanQuery();

    Term decterm = new Term(CObj.docPrivate(CObj.PRV_PUSH_REQ), "true");
    bq.add(new TermQuery(decterm), BooleanClause.Occur.MUST);

    Sort s = new Sort();
    s.setSort(new SortField(CObj.docPrivateNumber(CObj.PRV_PUSH_TIME), SortField.Type.LONG, false));

    return search(bq, Integer.MAX_VALUE, s);
  }
Beispiel #2
0
  public CObjList getUnDecodedMemberships(long lastdec) {
    BooleanQuery bq = new BooleanQuery();
    Term typterm = new Term(CObj.PARAM_TYPE, CObj.MEMBERSHIP);
    bq.add(new TermQuery(typterm), BooleanClause.Occur.MUST);

    Term nondec = new Term(CObj.docPrivate(CObj.DECODED), "false");
    bq.add(new TermQuery(nondec), BooleanClause.Occur.MUST);

    NumericRangeQuery<Long> nq =
        NumericRangeQuery.newLongRange(
            CObj.docPrivateNumber(CObj.LASTUPDATE), lastdec, Long.MAX_VALUE, true, true);
    bq.add(nq, BooleanClause.Occur.MUST);

    return search(bq, Integer.MAX_VALUE);
  }
Beispiel #3
0
  public CObjList getPushesToSend() {
    BooleanQuery bq = new BooleanQuery();

    // For a BooleanQuery with no MUST clauses one or more SHOULD clauses
    // must match a document for the BooleanQuery to match.
    Term decterm = new Term(CObj.docPrivate(CObj.PRV_PUSH_REQ), "true");
    bq.add(new TermQuery(decterm), BooleanClause.Occur.SHOULD);

    Term nocterm = new Term(CObj.docPrivate(CObj.PRV_PUSH_REQ), "nocon");
    bq.add(new TermQuery(nocterm), BooleanClause.Occur.SHOULD);

    Sort s = new Sort();
    s.setSort(new SortField(CObj.docPrivateNumber(CObj.PRV_PUSH_TIME), SortField.Type.LONG, false));

    return search(bq, Integer.MAX_VALUE, s);
  }