@Override protected Query writeQueryEdgeCondition(Query query) { ConditionQuery cq = (ConditionQuery) query; if (cq.hasRangeCondition()) { return this.writeQueryEdgeRangeCondition(cq); } else { return this.writeQueryEdgePrefixCondition(cq); } }
@Override protected Query writeQueryEdgeCondition(Query query) { ConditionQuery cq = (ConditionQuery) query; if (cq.hasRangeCondition()) { return this.writeQueryEdgeRangeCondition(cq); } else { return this.writeQueryEdgePrefixCondition(cq); } }
if (query.hasRangeCondition() || query.hasSearchCondition()) { matchedIndexLabels = matchRangeOrSearchIndexLabels(query, allILs); if (matchedIndexLabels.isEmpty()) {
private static Set<IndexLabel> matchSingleOrCompositeIndex( ConditionQuery query, Set<IndexLabel> indexLabels) { boolean reqiureRange = query.hasRangeCondition(); boolean reqiureSearch = query.hasSearchCondition(); Set<Id> queryPropKeys = query.userpropKeys();
private static NoIndexException noIndexException(HugeGraph graph, ConditionQuery query, Id label) { String name = label == null ? "any label" : String.format("label '%s'", query.resultType().isVertex() ? graph.vertexLabel(label).name() : graph.edgeLabel(label).name()); List<String> mismatched = new ArrayList<>(); if (query.hasSecondaryCondition()) { mismatched.add("secondary"); } if (query.hasRangeCondition()) { mismatched.add("range"); } if (query.hasSearchCondition()) { mismatched.add("search"); } return new NoIndexException("Don't accept query based on properties " + "%s that are not indexed in %s, " + "may not match %s condition", graph.mapPkId2Name(query.userpropKeys()), name, String.join("/", mismatched)); }
if (query.hasRangeCondition() || query.hasSearchCondition()) { Set<IndexLabel> matchedILs = matchRangeOrSearchIndexLabels(query, index.indexLabels());
private static ConditionQuery matchIndexLabel(ConditionQuery query, IndexLabel indexLabel) { IndexType indexType = indexLabel.indexType(); boolean requireRange = query.hasRangeCondition(); boolean isRange = indexType == IndexType.RANGE; if (requireRange && !isRange) {
if (query.hasRangeCondition()) { for (Condition condition : query.userpropConditions()) { assert condition instanceof Condition.Relation;
if (query.hasRangeCondition() || query.hasSearchCondition()) { matchedIndexLabels = matchRangeOrSearchIndexLabels(query, allILs); if (matchedIndexLabels.isEmpty()) {
private static NoIndexException noIndexException(HugeGraph graph, ConditionQuery query, Id label) { String name = label == null ? "any label" : String.format("label '%s'", query.resultType().isVertex() ? graph.vertexLabel(label).name() : graph.edgeLabel(label).name()); List<String> mismatched = new ArrayList<>(); if (query.hasSecondaryCondition()) { mismatched.add("secondary"); } if (query.hasRangeCondition()) { mismatched.add("range"); } if (query.hasSearchCondition()) { mismatched.add("search"); } return new NoIndexException("Don't accept query based on properties " + "%s that are not indexed in %s, " + "may not match %s condition", graph.mapPkId2Name(query.userpropKeys()), name, String.join("/", mismatched)); }
private static Set<IndexLabel> matchSingleOrCompositeIndex( ConditionQuery query, Set<IndexLabel> indexLabels) { boolean reqiureRange = query.hasRangeCondition(); boolean reqiureSearch = query.hasSearchCondition(); Set<Id> queryPropKeys = query.userpropKeys();
if (query.hasRangeCondition() || query.hasSearchCondition()) { Set<IndexLabel> matchedILs = matchRangeOrSearchIndexLabels(query, index.indexLabels());
private static ConditionQuery matchIndexLabel(ConditionQuery query, IndexLabel indexLabel) { IndexType indexType = indexLabel.indexType(); boolean requireRange = query.hasRangeCondition(); boolean isRange = indexType == IndexType.RANGE; if (requireRange && !isRange) {