private Filter collectionContains(IndexCollectionType collectionType) { Value val = getValue1(); int valType = val.getType(); switch (valType) { case ParticleType.INTEGER: return Filter.contains(getField(), collectionType, val.toLong()); case ParticleType.STRING: return Filter.contains(getField(), collectionType, val.toString()); } return null; }
public Scanner<T> filter(String nameOfField, boolean fieldValue) { setIndexName(type, setName, namespace, nameOfField); if (!boolean.class.isAssignableFrom(field.getType()) && !Boolean.class.isAssignableFrom(field.getType())) { throw new SpikeifyError("Can't query with boolean filter on: " + type + "#" + nameOfField + ", not a boolean field!"); } IndexCollectionType collectionType = IndexingService.getIndexCollectionType(type, field.getName()); if (IndexCollectionType.DEFAULT.equals(collectionType)) { return setFilters(Filter.equal(fieldName, fieldValue ? 1 : 0)); } return setFilters(Filter.contains(fieldName, collectionType, fieldValue ? 1 : 0)); }
public Scanner<T> filter(String nameOfField, String fieldValue) { setIndexName(type, setName, namespace, nameOfField); IndexCollectionType collectionType = IndexingService.getIndexCollectionType(type, field.getName()); if (IndexCollectionType.DEFAULT.equals(collectionType)) { return setFilters(Filter.equal(fieldName, fieldValue)); } return setFilters(Filter.contains(fieldName, collectionType, fieldValue)); }
public Scanner<T> filter(String nameOfField, long fieldValue) { setIndexName(type, setName, namespace, nameOfField); IndexCollectionType collectionType = IndexingService.getIndexCollectionType(type, field.getName()); if (IndexCollectionType.DEFAULT.equals(collectionType)) { return setFilters(Filter.equal(fieldName, fieldValue)); } return setFilters(Filter.contains(fieldName, collectionType, fieldValue)); }
stmt.setSetName(params.set); stmt.setBinNames(binName); stmt.setFilter(Filter.contains(binName, IndexCollectionType.MAPKEYS, queryMapKey));