private static Set<IndexLabel> matchRangeOrSearchIndexLabels( ConditionQuery query, Set<IndexLabel> indexLabels) { Set<IndexLabel> matchedIndexLabels = InsertionOrderUtil.newSet(); for (Condition.Relation relation : query.userpropRelations()) { if (!relation.relation().isRangeType() && !relation.relation().isSearchType()) { continue; } Id key = (Id) relation.key(); boolean matched = false; for (IndexLabel indexLabel : indexLabels) { if (indexLabel.indexType() == IndexType.RANGE || indexLabel.indexType() == IndexType.SEARCH) { if (indexLabel.indexField().equals(key)) { matched = true; matchedIndexLabels.add(indexLabel); break; } } } if (!matched) { return ImmutableSet.of(); } } return matchedIndexLabels; }
private static Set<IndexLabel> matchRangeOrSearchIndexLabels( ConditionQuery query, Set<IndexLabel> indexLabels) { Set<IndexLabel> matchedIndexLabels = InsertionOrderUtil.newSet(); for (Condition.Relation relation : query.userpropRelations()) { if (!relation.relation().isRangeType() && !relation.relation().isSearchType()) { continue; } Id key = (Id) relation.key(); boolean matched = false; for (IndexLabel indexLabel : indexLabels) { if (indexLabel.indexType() == IndexType.RANGE || indexLabel.indexType() == IndexType.SEARCH) { if (indexLabel.indexField().equals(key)) { matched = true; matchedIndexLabels.add(indexLabel); break; } } } if (!matched) { return ImmutableSet.of(); } } return matchedIndexLabels; }
public boolean hasSearchCondition() { // NOTE: we need to judge all the conditions, including the nested for (Condition.Relation r : this.relations()) { if (r.relation().isSearchType()) { return true; } } return false; }
public boolean hasSearchCondition() { // NOTE: we need to judge all the conditions, including the nested for (Condition.Relation r : this.relations()) { if (r.relation().isSearchType()) { return true; } } return false; }