Package dovetaildb.querynode

Examples of dovetaildb.querynode.OrderedOrQueryNode


    if (rec.token == bottom) {
      RangeQueryNode q = new BlueSteelPostingListQuery(prefix, rec.token, rec.segmentPush);
      q = FilteredRangeQueryNode.make(q, null, null, term2, false, isExclusive2);
      queries.add(q);
    }
    return new OrderedOrQueryNode(queries, prefix, term1, term2, isExclusive1, isExclusive2);
  }
View Full Code Here


      QueryNode q = index.getTerm(new CompoundBytes(ID_BYTES, new ArrayBytes(Util.decodeString(key))), revNum);
      if (q == null) throw new RuntimeException("Object not found; id=\""+key+"\"");
      clauses.add(q);
    }
    if (clauses.size() > 0) {
      QueryNode idQuery = new OrderedOrQueryNode(clauses, null, null, null, false, false);
      do {
        long docId = idQuery.doc();
        data.skipTo(docId);
        do {
          edits.add(new EditRec(docId, data.term(), true));
        } while(data.nextTerm() == NextStatus.NEXT_TERM);
      } while(idQuery.next());
    }
   
    long insId = -1;
    for(Map.Entry<String,Object> entry : value.getEntries().entrySet()) {
      String key = entry.getKey();
      QueryNode q = index.getTerm(new CompoundBytes(ID_BYTES, new ArrayBytes(Util.decodeString(key))), revNum);
      if (q != null) {
        clauses.add(q);
      } else {
        long docId = insId--;
        DbServiceUtil.sencodeMulti(ArrayBytes.EMPTY_BYTES, entry.getValue(), edits, docId, false);
      }
    }
    if (clauses.size() > 0) {
      QueryNode idQuery = new OrderedOrQueryNode(clauses, null, null, null, false, false);
      Map<String, Object> entries = value.getEntries();
      do {
        long docId = idQuery.doc();
        Bytes idTerm = idQuery.term();
        byte[] idBytes = idTerm.subBytes(NUM_ID_BYTES, idTerm.getLength()-NUM_ID_BYTES).getBytes();
        Object val = entries.get(Util.encodeBytes(idBytes));
        DbServiceUtil.sencodeMulti(ArrayBytes.EMPTY_BYTES, val, edits, docId, false);
      } while(idQuery.next());
    }
    return edits;
  }
View Full Code Here

          QueryNodeTemplate node=applyPatternToBagIndex(prefix, query.get(i), index, revNum);
          if (node.queryNode != null) clauses.add(node.queryNode);
          vars.putAll(node.varMappings);
        }
        if (opHash == DbServiceUtil.OP_HASH_OR) {
          queryNode = new OrderedOrQueryNode(clauses, null, null, null, false, false);
        } else {
          queryNode = AndQueryNode.make(clauses);
        }
        break;
      case DbServiceUtil.OP_HASH_NOT:
View Full Code Here

      for(int i=0; i<numArgs; i++) {
        QueryNode node=applyQueryToBagIndex((List)query.get(i+1), index, encoder, revNum);
        if (node != null) clauses.add(node);
      }
      if (opHash == CopyOfDbServiceUtilDelme.OP_HASH_OR) {
        return new OrderedOrQueryNode(clauses, null, null, null, false, false);
      } else {
        return AndQueryNode.make(clauses);
      }
    case CopyOfDbServiceUtilDelme.OP_HASH_NOT:
      throw new RuntimeException("Not supported");
View Full Code Here

TOP

Related Classes of dovetaildb.querynode.OrderedOrQueryNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.